diff --git a/src/module/ngx-auth-firebase-u-i.module.ts b/src/module/ngx-auth-firebase-u-i.module.ts index 24637102..b34b11d3 100755 --- a/src/module/ngx-auth-firebase-u-i.module.ts +++ b/src/module/ngx-auth-firebase-u-i.module.ts @@ -1,5 +1,5 @@ import {CommonModule} from '@angular/common'; -import {NgModule, ModuleWithProviders, InjectionToken} from '@angular/core'; +import {NgModule, ModuleWithProviders, InjectionToken, Inject} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {HttpClientModule} from '@angular/common/http'; import {AuthComponent} from './components/auth/auth.component'; @@ -99,7 +99,7 @@ export const NgxAuthFirebaseUIConfigToken = new InjectionToken string, - config: NgxAuthFirebaseUIConfig = defaultAuthFirebaseUIConfig): ModuleWithProviders { + config?: NgxAuthFirebaseUIConfig): ModuleWithProviders { return { ngModule: NgxAuthFirebaseUIModule, providers: @@ -122,4 +122,9 @@ export class NgxAuthFirebaseUIModule { ], }; } + + constructor(@Inject(NgxAuthFirebaseUIConfigToken) + public config: NgxAuthFirebaseUIConfig) { + this.config = Object.assign(defaultAuthFirebaseUIConfig, this.config); + } }