refactor(testability): rename function to get testability

Previously, getting testability was `window.angular2.getTestability`
This was because the plan was to export the API to the window as
angular2. However, the decision was changed to make this just `angular`
in 3177576ad6

To decouple testability from the rest of the Angular API, just make it
one function, `window.getAngularTestability`.
This commit is contained in:
Julie Ralph 2015-04-16 11:00:13 -07:00
parent a97a2266d3
commit 817c79ca77
2 changed files with 3 additions and 13 deletions

View File

@ -85,12 +85,9 @@ class PublicTestability implements _JsObjectProxyable {
class GetTestability {
static addToWindow(TestabilityRegistry registry) {
js.context['angular2'] = _jsify({
'getTestability': (Element elem) {
js.context['getAngularTestability'] = _jsify((Element elem) {
Testability testability = registry.findTestabilityInTree(elem);
return _jsify(new PublicTestability(testability));
},
'resumeBootstrap': ([arg]) {},
});
});
}
}

View File

@ -19,10 +19,7 @@ class PublicTestability {
export class GetTestability {
static addToWindow(registry: TestabilityRegistry) {
if (!global.angular2) {
global.angular2 = {};
}
global.angular2.getTestability = function(elem): PublicTestability {
global.getAngularTestability = function(elem): PublicTestability {
var testability = registry.findTestabilityInTree(elem);
if (testability == null) {
@ -30,9 +27,5 @@ export class GetTestability {
}
return new PublicTestability(testability);
};
global.angular2.resumeBootstrap = function() {
// Intentionally left blank. This will allow Protractor to run
// against angular2 without turning off Angular synchronization.
};
}
}