angular/modules/@angular/router/src/lifecycle_reflector.ts

9 lines
267 B
TypeScript
Raw Normal View History

2016-05-02 17:36:58 +00:00
import {Type, isBlank} from './facade/lang';
export function hasLifecycleHook(name: string, obj: Object): boolean {
2016-04-30 01:05:06 +00:00
if (isBlank(obj)) return false;
let type = obj.constructor;
if (!(type instanceof Type)) return false;
return name in(<any>type).prototype;
}