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

9 lines
278 B
TypeScript
Raw Normal View History

import {Type, isBlank} from '@angular/facade/src/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;
}