Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

158
Vistas
How to use methods of classes in Angular export function

I'd like to use a method in a export function defined in a class file.

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 { }

This is the Service Class

@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;
    }
}

How can I use AzureService.getConfiguration() method in the exported function method in the Module. I want this because the values are dynamic and they are obtained in a rest call.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

try

const Service = new AzureService(IdentityManagerApiRestService)
let a = Service.getConfiguration()
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda