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

348
Visualizações
Angular 4 - Load Firebase auth parameters from config file

I'm building an Angular 4 app with Firebase, I do not want to save my Firebase configuration/initialization parameters in my app.modules.ts file, as this file is to be committed to my repo. In dev mode, I was able to save the setting using export default {firebase {...}} in a config.ts file and load the params from there. However, when I build using Angular CLI, these parameters are not loaded.

The solutions I've found online so far, all work as services, but I need to be able to load these parameters when importing modules in my AppModules class.

Any ideas please?

Best regards,

Benjamin

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

For anyone interested. Final solution based on a suggestion from a kind hearted soul :) was.

import { FirebaseConfigInterface } from './interfaces/firebase-config.interface';

export class AppConfig {
    public static site = {
        meta_title: null,
        app_id: null
    };

    public static firebaseConfig: FirebaseConfigInterface = {
        apiKey: null,
        authDomain: null,
        databaseURL: null,
        storageBucket: null,
        messagingSenderId: null
    }
};

I imported AppConfig to access it's static variables.

import {AppConfig} from './app.config';
over 4 years ago · Santiago Trujillo 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