mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
9 lines
267 B
TypeScript
9 lines
267 B
TypeScript
import {Type, isBlank} from './facade/lang';
|
|
|
|
export function hasLifecycleHook(name: string, obj: Object): boolean {
|
|
if (isBlank(obj)) return false;
|
|
let type = obj.constructor;
|
|
if (!(type instanceof Type)) return false;
|
|
return name in(<any>type).prototype;
|
|
}
|