refactor: remove facade/collection (#14837)

This commit is contained in:
Miško Hevery
2017-03-01 14:10:59 -08:00
committed by Chuck Jazdzewski
parent 4fe0b90948
commit b0e0839075
27 changed files with 149 additions and 244 deletions

View File

@ -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);
}
}