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