Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

149
Visualizações
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 Respostas
Responde à pergunta

0

try

const Service = new AzureService(IdentityManagerApiRestService)
let a = Service.getConfiguration()
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda