{
provide: APP_INITIALIZER,
useFactory: appInit,
deps: [DocumentsSettings],
multi: true,
},
export function appInit(settings: DocumentsSettings) {
return () => settings.init();
}
@Injectable()
export class DocumentsSettings implements Settings {
private readonly url = `${environment.apiUrl}/documents`;
public init() {
return new Promise((resolve, reject) => {
alert();
resolve(true);
});
}
}
alert()
не выводится.