Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

343
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!