Closed timbell closed 7 years ago
You can use a plain object with the same fields instead of a class now. AOT support is now working in Beta.3
My app configuration (including auth) is stored on a server, on a per-app basis. I retrieve this at start-up using a service. I then provide the config to ng2-ui-auth via my service by injecting it into a custom CustomConfig class.
@Injectable()
export class AuthConfig extends CustomConfig {
constructor(private appConfigService: AppConfigService) {
super();
this.providers = appConfigService.appConfig.authProviders;
}
}
...
Ng2UiAuthModule.forRoot(AuthConfig)
I don't see how I can achieve the equivalent with the the recent changes.
Interesting use case. I'll look into it.
try beta 4 provide your own AuthConfig using:
...
{ provide: CONFIG_OPTIONS, useClass: AuthConfig, deps: [AppConfigService] },
Ng2UiAuthModule.forRootWithoutOptions(),
...
Thanks, yes that works. (I had to work around the interceptor injecting my AppConfigService via ConfigService/CONFIG_OPTIONS by forgoing the use of HttpClient in AppConfigService.)
The useClass / CustomConfig support has been removed in beta.2. I was using this to provide the config from a class that injected my own app config service.
Would you consider reinstating this functionality?