refactor(facade): refactor type check function - is*()
This commit is contained in:
@ -12,6 +12,7 @@ import {
|
||||
stringify,
|
||||
getMapKey,
|
||||
looseIdentical,
|
||||
isArray
|
||||
} from 'angular2/src/facade/lang';
|
||||
|
||||
import {WrappedValue, Pipe, PipeFactory} from './pipe';
|
||||
@ -123,7 +124,7 @@ export class IterableChanges extends Pipe {
|
||||
var index: int;
|
||||
var item;
|
||||
|
||||
if (ListWrapper.isList(collection)) {
|
||||
if (isArray(collection)) {
|
||||
var list = collection;
|
||||
this._length = collection.length;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Promise, PromiseWrapper} from 'angular2/src/facade/async';
|
||||
import {isBlank, isPresent} from 'angular2/src/facade/lang';
|
||||
import {isBlank, isPresent, isPromise} from 'angular2/src/facade/lang';
|
||||
import {Pipe, WrappedValue} from './pipe';
|
||||
import {ChangeDetectorRef} from '../change_detector_ref';
|
||||
|
||||
@ -41,7 +41,7 @@ export class PromisePipe extends Pipe {
|
||||
this._latestReturnedValue = null;
|
||||
}
|
||||
|
||||
supports(promise): boolean { return PromiseWrapper.isPromise(promise); }
|
||||
supports(promise): boolean { return isPromise(promise); }
|
||||
|
||||
onDestroy(): void {
|
||||
if (isPresent(this._sourcePromise)) {
|
||||
@ -87,7 +87,7 @@ export class PromisePipe extends Pipe {
|
||||
* @exportedAs angular2/pipes
|
||||
*/
|
||||
export class PromisePipeFactory {
|
||||
supports(promise): boolean { return PromiseWrapper.isPromise(promise); }
|
||||
supports(promise): boolean { return isPromise(promise); }
|
||||
|
||||
create(cdRef): Pipe { return new PromisePipe(cdRef); }
|
||||
}
|
||||
|
Reference in New Issue
Block a user