refactor(core): Move LifeCycle functionality into ApplicationRef.

BREAKING CHANGE:

Before: constructor(@Inject(LifeCycle) lifecycle) { lifecycle.tick(); }
After: constructor(@Inject(ApplicationRef) appRef) { appRef.tick(); }

Closes #5008
This commit is contained in:
Alex Rickabaugh
2015-10-28 10:34:13 -07:00
parent ef23fe66a0
commit 72e65d6797
19 changed files with 144 additions and 182 deletions

View File

@ -126,6 +126,14 @@ export abstract class ChangeDetectorRef {
*/
abstract detectChanges(): void;
/**
* Checks the change detector and its children, and throws if any changes are detected.
*
* This is used in development mode to verify that running change detection doesn't introduce
* other changes.
*/
abstract checkNoChanges(): void;
/**
* Reattach the change detector to the change detector tree.
*
@ -192,6 +200,7 @@ export class ChangeDetectorRef_ extends ChangeDetectorRef {
markForCheck(): void { this._cd.markPathToRootAsCheckOnce(); }
detach(): void { this._cd.mode = ChangeDetectionStrategy.Detached; }
detectChanges(): void { this._cd.detectChanges(); }
checkNoChanges(): void { this._cd.checkNoChanges(); }
reattach(): void {
this._cd.mode = ChangeDetectionStrategy.CheckAlways;
this.markForCheck();