From 3be07add3a48ce204d11ef9990f5d57c846bb1c8 Mon Sep 17 00:00:00 2001 From: Martin Hochel Date: Sun, 8 May 2016 17:29:22 +0200 Subject: [PATCH] feat(core/change_detection): properly inject ChangeDetectorRef as local dependency to component/directive --- src/core/directives/util/util.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/directives/util/util.ts b/src/core/directives/util/util.ts index d7f5dee..92be537 100644 --- a/src/core/directives/util/util.ts +++ b/src/core/directives/util/util.ts @@ -20,6 +20,7 @@ import { StringWrapper } from '../../../facade/primitives'; import { ChangeDetectionUtil, SimpleChange } from '../../change_detection/change_detection_util'; import { changesQueueService } from '../../change_detection/changes_queue'; import { EventEmitter } from '../../../facade/async'; +import { ChangeDetectorRef } from '../../change_detection/change_detector_ref'; const REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/; @@ -259,12 +260,15 @@ export function directiveControllerFactory( '$parse' ), $interpolate: $injector.get( '$interpolate' ), $rootScope: $injector.get( '$rootScope' ) }; - const { $scope, $element, $attrs } = locals; + const _localServices = { + changeDetectorRef: ChangeDetectorRef.create( $scope ) + }; // Create an instance of the controller without calling its constructor const instance = Object.create( controller.prototype ); @@ -302,7 +306,7 @@ export function directiveControllerFactory