feat(decorators): adds decorator versions of DI annotations.
In 'angular2/di' the symbol: - Inject is a decorator - InjectAnnotation is an annotation Internally one an get a hold of annotations without *Annotations appened (to make ts2dart work without workarounds) by importing from 'angular2/src/di/annotations_impl' instead of 'angular2/di'. This is needed only for users that transpile through TS and through ts2dart.
This commit is contained in:
3
modules/angular2/src/core/annotations/decorators.dart
Normal file
3
modules/angular2/src/core/annotations/decorators.dart
Normal file
@ -0,0 +1,3 @@
|
||||
library angular2.core.decorators;
|
||||
|
||||
/* This file is empty because, Dart does not have decorators. */
|
23
modules/angular2/src/core/annotations/decorators.es6
Normal file
23
modules/angular2/src/core/annotations/decorators.es6
Normal file
@ -0,0 +1,23 @@
|
||||
import {
|
||||
ComponentAnnotation,
|
||||
DirectiveAnnotation
|
||||
} from './annotations';
|
||||
import {ViewAnnotation} from './view';
|
||||
import {AncestorAnnotation, ParentAnnotation} from './visibility';
|
||||
import {AttributeAnnotation, QueryAnnotation} from './di';
|
||||
import {makeDecorator, makeParamDecorator} from '../../util/decorators';
|
||||
|
||||
/* from annotations */
|
||||
export var Component = makeDecorator(ComponentAnnotation);
|
||||
export var Decorator = makeDecorator(DirectiveAnnotation);
|
||||
|
||||
/* from view */
|
||||
export var View = makeDecorator(ViewAnnotation);
|
||||
|
||||
/* from visibility */
|
||||
export var Ancestor = makeParamDecorator(AncestorAnnotation);
|
||||
export var Parent = makeParamDecorator(ParentAnnotation);
|
||||
|
||||
/* from di */
|
||||
export var Attribute = makeParamDecorator(AttributeAnnotation);
|
||||
export var Query = makeParamDecorator(QueryAnnotation);
|
Reference in New Issue
Block a user