feat(ivy): support injecting ChangeDetectorRef (#22469)

PR Close #22469
This commit is contained in:
Kara Erickson
2018-02-26 16:58:15 -08:00
committed by Alex Eagle
parent aabe16c08c
commit 9eaf1bbe67
9 changed files with 491 additions and 123 deletions

View File

@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ChangeDetectorRef} from '../../change_detection/change_detector_ref';
import {Injector} from '../../di/injector';
import {ElementRef} from '../../linker/element_ref';
import {TemplateRef} from '../../linker/template_ref';
@ -66,6 +67,12 @@ export interface LInjector {
/** Stores the ElementRef so subsequent injections of the ElementRef get the same instance. */
elementRef: ElementRef|null;
/**
* Stores the ChangeDetectorRef so subsequent injections of the ChangeDetectorRef get the
* same instance.
*/
changeDetectorRef: ChangeDetectorRef|null;
}
// Note: This hack is necessary so we don't erroneously get a circular dependency