refactor: remove facade/collection (#14837)
This commit is contained in:

committed by
Chuck Jazdzewski

parent
4fe0b90948
commit
b0e0839075
@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import {ResourceLoader} from '@angular/compiler';
|
||||
import {ListWrapper} from './facade/collection';
|
||||
import {isBlank} from './facade/lang';
|
||||
|
||||
/**
|
||||
@ -82,7 +81,7 @@ export class MockResourceLoader extends ResourceLoader {
|
||||
if (this._expectations.length > 0) {
|
||||
const expectation = this._expectations[0];
|
||||
if (expectation.url == url) {
|
||||
ListWrapper.remove(this._expectations, expectation);
|
||||
remove(this._expectations, expectation);
|
||||
request.complete(expectation.response);
|
||||
return;
|
||||
}
|
||||
@ -129,3 +128,10 @@ class _Expectation {
|
||||
this.response = response;
|
||||
}
|
||||
}
|
||||
|
||||
function remove<T>(list: T[], el: T): void {
|
||||
const index = list.indexOf(el);
|
||||
if (index > -1) {
|
||||
list.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user