refactor: remove global
from facade/lang (#14837)
This commit is contained in:

committed by
Chuck Jazdzewski

parent
b0e0839075
commit
84a65cf788
@ -6,8 +6,9 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ɵglobal as global} from '@angular/core';
|
||||
import {setRootDomAdapter} from '../dom/dom_adapter';
|
||||
import {global, isBlank, isPresent, setValueOnPath} from '../facade/lang';
|
||||
import {isBlank, isPresent, setValueOnPath} from '../facade/lang';
|
||||
|
||||
import {GenericBrowserDomAdapter} from './generic_browser_adapter';
|
||||
|
||||
|
@ -6,16 +6,16 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {GetTestability, Testability, TestabilityRegistry, setTestabilityGetter} from '@angular/core';
|
||||
import {GetTestability, Testability, TestabilityRegistry, setTestabilityGetter, ɵglobal as global} from '@angular/core';
|
||||
|
||||
import {getDOM} from '../dom/dom_adapter';
|
||||
import {global, isPresent} from '../facade/lang';
|
||||
import {isPresent} from '../facade/lang';
|
||||
|
||||
export class BrowserGetTestability implements GetTestability {
|
||||
static init() { setTestabilityGetter(new BrowserGetTestability()); }
|
||||
|
||||
addToWindow(registry: TestabilityRegistry): void {
|
||||
global.getAngularTestability = (elem: any, findInAncestors: boolean = true) => {
|
||||
global['getAngularTestability'] = (elem: any, findInAncestors: boolean = true) => {
|
||||
const testability = registry.findTestabilityInTree(elem, findInAncestors);
|
||||
if (testability == null) {
|
||||
throw new Error('Could not find testability for element.');
|
||||
@ -23,12 +23,12 @@ export class BrowserGetTestability implements GetTestability {
|
||||
return testability;
|
||||
};
|
||||
|
||||
global.getAllAngularTestabilities = () => registry.getAllTestabilities();
|
||||
global['getAllAngularTestabilities'] = () => registry.getAllTestabilities();
|
||||
|
||||
global.getAllAngularRootElements = () => registry.getAllRootElements();
|
||||
global['getAllAngularRootElements'] = () => registry.getAllRootElements();
|
||||
|
||||
const whenAllStable = (callback: any /** TODO #9100 */) => {
|
||||
const testabilities = global.getAllAngularTestabilities();
|
||||
const testabilities = global['getAllAngularTestabilities']();
|
||||
let count = testabilities.length;
|
||||
let didWork = false;
|
||||
const decrement = function(didWork_: any /** TODO #9100 */) {
|
||||
|
Reference in New Issue
Block a user