2016-04-28 17:50:03 -07:00
|
|
|
import {Type, isBlank} from '@angular/facade/src/lang';
|
2016-04-22 12:05:38 -07:00
|
|
|
|
|
|
|
|
export function hasLifecycleHook(name: string, obj: Object): boolean {
|
2016-04-29 18:05:06 -07:00
|
|
|
if (isBlank(obj)) return false;
|
2016-04-22 12:05:38 -07:00
|
|
|
let type = obj.constructor;
|
|
|
|
|
if (!(type instanceof Type)) return false;
|
|
|
|
|
return name in(<any>type).prototype;
|
|
|
|
|
}
|