|
2 | 2 | * @module
|
3 | 3 | * @public
|
4 | 4 | * @description
|
5 |
| - * Common directives shipped with Angualr. |
| 5 | + * Common directives shipped with Angular. |
6 | 6 | */
|
7 | 7 |
|
| 8 | +import {CONST_EXPR} from './src/facade/lang'; |
| 9 | +import {For} from './src/directives/for'; |
| 10 | +import {If} from './src/directives/if'; |
| 11 | +import {NonBindable} from './src/directives/non_bindable'; |
| 12 | +import {Switch, SwitchWhen, SwitchDefault} from './src/directives/switch'; |
| 13 | + |
8 | 14 | export * from './src/directives/class';
|
9 | 15 | export * from './src/directives/for';
|
10 | 16 | export * from './src/directives/if';
|
11 | 17 | export * from './src/directives/non_bindable';
|
12 | 18 | export * from './src/directives/switch';
|
| 19 | + |
| 20 | +/** |
| 21 | + * A collection of the Angular core directives that are likely to be used in each and every Angular application. |
| 22 | + * |
| 23 | + * This collection can be used to quickly enumerate all the built-in directives in the `@View` annotation. For example, |
| 24 | + * instead of writing: |
| 25 | + * |
| 26 | + * ``` |
| 27 | + * import {If, For, Switch, SwitchWhen, SwitchDefault} from 'angular2/angular2'; |
| 28 | + * import {OtherDirective} from 'myDirectives'; |
| 29 | + * |
| 30 | + * @Component({ |
| 31 | + * selector: 'my-component' |
| 32 | + * }) |
| 33 | + * @View({ |
| 34 | + * templateUrl: 'myComponent.html', |
| 35 | + * directives: [If, For, Switch, SwitchWhen, SwitchDefault, OtherDirective] |
| 36 | + * }) |
| 37 | + * export class MyComponent { |
| 38 | + * ... |
| 39 | + * } |
| 40 | + * ``` |
| 41 | + * one could enumerate all the core directives at once: |
| 42 | + * |
| 43 | + ** ``` |
| 44 | + * import {coreDirectives} from 'angular2/angular2'; |
| 45 | + * import {OtherDirective} from 'myDirectives'; |
| 46 | + * |
| 47 | + * @Component({ |
| 48 | + * selector: 'my-component' |
| 49 | + * }) |
| 50 | + * @View({ |
| 51 | + * templateUrl: 'myComponent.html', |
| 52 | + * directives: [coreDirectives, OtherDirective] |
| 53 | + * }) |
| 54 | + * export class MyComponent { |
| 55 | + * ... |
| 56 | + * } |
| 57 | + * ``` |
| 58 | + * |
| 59 | + */ |
| 60 | +export const coreDirectives:List = CONST_EXPR([ |
| 61 | + For, If, NonBindable, Switch, SwitchWhen, SwitchDefault |
| 62 | +]); |
0 commit comments