Me gustaría usar un método en una función de exportación definida en un archivo de clase.
export function MSALInstanceFactory(): IPublicClientApplication { return new PublicClientApplication({ auth: AzureService.getConfiguration(), <-------- Compilation Error cache: { cacheLocation: BrowserCacheLocation.LocalStorage, storeAuthStateInCookie: isIE, // set to true for IE 11. Remove this line to use Angular Universal } }); } export class AzureModule { }Esta es la clase de servicio
@Injectable() export class AzureService { constructor(private identityManagerApiRestService: IdentityManagerApiRestService) { } getConfiguration(): BrowserAuthOptions { let options: BrowserAuthOptions; this.identityManagerApiRestService.getAuthenticationConfiguration().subscribe(response =>{ options.clientId = response.authenticationConfiguration.clientId; options.authority = response.authenticationConfiguration.authority; options.redirectUri = response.authenticationConfiguration.redirectUri; }); return options; } }¿Cómo puedo usar el método AzureService.getConfiguration() en el método de función exportado en el módulo. Quiero esto porque los valores son dinámicos y se obtienen en una llamada de descanso.
probar
const Service = new AzureService(IdentityManagerApiRestService) let a = Service.getConfiguration()