UNPKG

846 BJavaScriptView Raw
1"use strict";
2var core_1 = require('@angular/core');
3var core_private_1 = require('../../core_private');
4var lifecycle_annotations_impl_1 = require('./lifecycle_annotations_impl');
5function hasLifecycleHook(e, type /** TODO #9100 */) {
6 if (!(type instanceof core_1.Type))
7 return false;
8 return e.name in type.prototype;
9}
10exports.hasLifecycleHook = hasLifecycleHook;
11function 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}
21exports.getCanActivateHook = getCanActivateHook;
22//# sourceMappingURL=route_lifecycle_reflector.js.map
\No newline at end of file