From 788461b7e2e53fbaa8fb745ce8ee73275f279d0a Mon Sep 17 00:00:00 2001 From: Tim Blasi Date: Tue, 31 Mar 2015 12:36:43 -0700 Subject: [PATCH] feat(di): Mark objects @Injectable Allow `PrivateComponentLoader`, `Testability`, and `TestabilityRegistry` to be injected. --- modules/angular2/src/core/compiler/private_component_loader.js | 2 ++ modules/angular2/src/core/testability/testability.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/modules/angular2/src/core/compiler/private_component_loader.js b/modules/angular2/src/core/compiler/private_component_loader.js index 6fef306425..7bb69157ab 100644 --- a/modules/angular2/src/core/compiler/private_component_loader.js +++ b/modules/angular2/src/core/compiler/private_component_loader.js @@ -1,5 +1,6 @@ import {Compiler} from './compiler'; import {ShadowDomStrategy} from './shadow_dom_strategy'; +import {Injectable} from 'angular2/di'; import {EventManager} from 'angular2/src/render/dom/events/event_manager'; import {DirectiveMetadataReader} from 'angular2/src/core/compiler/directive_metadata_reader'; import {Component} from 'angular2/src/core/annotations/annotations'; @@ -7,6 +8,7 @@ import {PrivateComponentLocation} from './private_component_location'; import {Type, stringify, BaseException} from 'angular2/src/facade/lang'; +@Injectable() export class PrivateComponentLoader { compiler:Compiler; shadowDomStrategy:ShadowDomStrategy; diff --git a/modules/angular2/src/core/testability/testability.js b/modules/angular2/src/core/testability/testability.js index bad334bb27..f04f154e6a 100644 --- a/modules/angular2/src/core/testability/testability.js +++ b/modules/angular2/src/core/testability/testability.js @@ -1,3 +1,4 @@ +import {Injectable} from 'angular2/di'; import {DOM} from 'angular2/src/dom/dom_adapter'; import {Map, MapWrapper, List, ListWrapper} from 'angular2/src/facade/collection'; import {StringWrapper, isBlank, BaseException} from 'angular2/src/facade/lang'; @@ -9,6 +10,7 @@ import * as getTestabilityModule from 'angular2/src/core/testability/get_testabi * the browser and by services such as Protractor. Each bootstrapped Angular * application on the page will have an instance of Testability. */ +@Injectable() export class Testability { _pendingCount: number; _callbacks: List; @@ -53,6 +55,7 @@ export class Testability { } } +@Injectable() export class TestabilityRegistry { _applications: Map;