refactor(core): removed getter and changed to readonly variable (#19117)

PR Close #19117
This commit is contained in:
Yuan Gao
2017-09-08 18:06:33 -07:00
committed by Igor Minar
parent 549f2254b4
commit b14c2d1568
9 changed files with 62 additions and 77 deletions

View File

@ -27,11 +27,11 @@ export class ApplicationInitStatus {
private resolve: Function;
private reject: Function;
private initialized = false;
private _donePromise: Promise<any>;
private _done = false;
public readonly donePromise: Promise<any>;
public readonly done = false;
constructor(@Inject(APP_INITIALIZER) @Optional() private appInits: (() => any)[]) {
this._donePromise = new Promise((res, rej) => {
this.donePromise = new Promise((res, rej) => {
this.resolve = res;
this.reject = rej;
});
@ -46,7 +46,7 @@ export class ApplicationInitStatus {
const asyncInitPromises: Promise<any>[] = [];
const complete = () => {
this._done = true;
(this as{done: boolean}).done = true;
this.resolve();
};
@ -66,8 +66,4 @@ export class ApplicationInitStatus {
}
this.initialized = true;
}
get done(): boolean { return this._done; }
get donePromise(): Promise<any> { return this._donePromise; }
}