32 lines
790 B
TypeScript
Raw Normal View History

2019-09-19 10:40:16 +09:00
import { NgModule, APP_INITIALIZER } from '@angular/core';
2019-09-18 15:02:21 +09:00
import { UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native';
import { ElectronNativeService } from '@ucap-webmessenger/native-electron';
2019-09-19 14:15:43 +09:00
import { RESOLVERS } from './resolvers';
2019-09-19 10:40:16 +09:00
import { SERVICES } from './services';
import { AppService } from './services/app.service';
export function initializeApp(appService: AppService) {
return (): Promise<any> => {
return appService.postInit();
};
}
2019-09-18 15:02:21 +09:00
@NgModule({
imports: [],
exports: [],
providers: [
...SERVICES,
2019-09-19 14:15:43 +09:00
...RESOLVERS,
2019-09-19 10:40:16 +09:00
{
provide: APP_INITIALIZER,
useFactory: initializeApp,
deps: [AppService],
multi: true
},
2019-09-18 15:02:21 +09:00
{ provide: UCAP_NATIVE_SERVICE, useClass: ElectronNativeService }
]
})
export class AppProviderModule {}