1 | "use strict";
|
2 | var core_1 = require('@angular/core');
|
3 | var core_private_1 = require('../../core_private');
|
4 | var lifecycle_annotations_impl_1 = require('./lifecycle_annotations_impl');
|
5 | function hasLifecycleHook(e, type /** TODO #9100 */) {
|
6 | if (!(type instanceof core_1.Type))
|
7 | return false;
|
8 | return e.name in type.prototype;
|
9 | }
|
10 | exports.hasLifecycleHook = hasLifecycleHook;
|
11 | function getCanActivateHook(type /** TODO #9100 */) {
|
12 | var annotations = core_private_1.reflector.annotations(type);
|
13 | for (var i = 0; i < annotations.length; i += 1) {
|
14 | var annotation = annotations[i];
|
15 | if (annotation instanceof lifecycle_annotations_impl_1.CanActivate) {
|
16 | return annotation.fn;
|
17 | }
|
18 | }
|
19 | return null;
|
20 | }
|
21 | exports.getCanActivateHook = getCanActivateHook;
|
22 |
|
\ | No newline at end of file |