angular-cn/modules/angular2/src/router/lifecycle_annotations.ts

22 lines
697 B
TypeScript
Raw Normal View History

/**
* This indirection is needed to free up Component, etc symbols in the public API
* to be used by the decorator versions of these annotations.
*/
import {makeDecorator} from 'angular2/src/util/decorators';
import {CanActivate as CanActivateAnnotation} from './lifecycle_annotations_impl';
import {Promise} from 'angular2/src/facade/async';
import {Instruction} from 'angular2/src/router/instruction';
export {
canReuse,
canDeactivate,
onActivate,
onReuse,
onDeactivate
} from './lifecycle_annotations_impl';
export var CanActivate:
(hook: (next: Instruction, prev: Instruction) => Promise<boolean>| boolean) => ClassDecorator =
makeDecorator(CanActivateAnnotation);