Skip to content

Instantly share code, notes, and snippets.

@GaetanoPiazzolla
Created May 21, 2021 12:52
Show Gist options
  • Save GaetanoPiazzolla/4e50bbf202292ec0d31ed21ff0752026 to your computer and use it in GitHub Desktop.
Save GaetanoPiazzolla/4e50bbf202292ec0d31ed21ff0752026 to your computer and use it in GitHub Desktop.
import {APP_INITIALIZER} from '@angular/core'
import {SingletonSecureStorageService} from './services/.... '
@NgModule({
declarations: [ /*.. components...*/ ],
imports: [ /*.. modules .. */],
providers: [
SingletonSecureStorageService,
{
provide: APP_INITIALIZER,
useFactory: (ds: SingletonSecureStorageService) => () => ds.init(),
deps: [SingletonSecureStorageService],
multi: true
}
]
})
@GaetanoPiazzolla
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment