I\'ve created company internal library using angualr2-library yeoman generator.
Some of the angular services are using environment variables in our current applicati
If you're trying to pass the environment variable for firebase, simply use this in your library:
@NgModule({
declarations: [MyAngularComponent],
exports: [MyAngularComponent],
imports: [
AngularFireModule,
AngularFirestoreModule,
CommonModule
]
})
export class MyAngularModule {
public static forRoot(firebaseConfig: FirebaseOptions): ModuleWithProviders {
return {
ngModule: MyAngularModule,
providers: [
{ provide: FIREBASE_OPTIONS, useValue: firebaseConfig }
]
}
}
}
And import it just like AngularFire...
MyAngularModule.forRoot(environment.firebase)
From this post: pass angularFire config imported in library using forRoot