style(DI): idiomatic TS

This commit is contained in:
Victor Berchet
2015-06-17 10:12:06 +02:00
parent edd01615c3
commit ffd1ac425e
5 changed files with 13 additions and 19 deletions

View File

@ -1,4 +1,4 @@
import {Type, stringify} from 'angular2/src/facade/lang';
import {Type, stringify, isFunction} from 'angular2/src/facade/lang';
export interface ForwardRefFn { (): any; }
@ -42,7 +42,7 @@ export function forwardRef(forwardRefFn: ForwardRefFn): Type {
* @exportedAs angular2/di
*/
export function resolveForwardRef(type: any): any {
if (typeof type == 'function' && type.hasOwnProperty('__forward_ref__') &&
if (isFunction(type) && type.hasOwnProperty('__forward_ref__') &&
type.__forward_ref__ === forwardRef) {
return (<ForwardRefFn>type)();
} else {