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

344
Vistas
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 Respuestas
Responde la pregunta

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