본문 바로가기

Cloud/Microsoft 365

Microsoft Office Add-in with Angular

728x90
반응형
SMALL

Angular로 Office Add-in 개발할 때 HashLocationStrategy를 사용해야 한다.

HashLocationStrategy를 지정하지 않으면 애플리케이션의 경로 탐색이 작동하지 않을 수 있다고 한다.

 


HashLocationStrategy 설정 방법

import { LocationStrategy, HashLocationStrategy } from '@angular/common';
// Other imports suppressed for brevity

@NgModule({
  providers: [
    { provide: LocationStrategy, useClass: HashLocationStrategy },
    // Other providers suppressed
  ],
  // Other module properties suppressed
})
export class AppModule { }
import { RouterModule, Routes } from '@angular/router';
// Other imports suppressed for brevity

const routes: Routes = // route definitions go here

@NgModule({
  imports: [RouterModule.forRoot(routes, { useHash: true })],
  exports: [RouterModule]
})
export class AppRoutingModule { }

 

가이드 문서 : https://docs.microsoft.com/en-us/office/dev/add-ins/develop/add-ins-with-angular2

728x90
반응형
LIST

'Cloud > Microsoft 365' 카테고리의 다른 글

Onedrvie 파일 업로드 API  (0) 2022.04.01
Outlook 조직도 개발 기초  (0) 2022.04.01
OneDrive API  (0) 2022.04.01
Outlook Addin 배포  (0) 2022.04.01
[M365] Office 추가 기능 배포 방법 - Outlook 추가 기능 배포  (0) 2020.05.26