Jeff Cross f14b212dc9 refactor: export core APIs from angular2/core
This change moves many APIs to the angular2/core export.

This change also automatically adds FORM_BINDINGS in
the application root injector.

BREAKING CHANGE:
    Many dependencies that were previously exported from specific
    APIs are now exported from angular2/core. Affected exports, which
    should now be included from angular2/core include:

    angular2/forms
    angular2/di
    angular2/directives
    angular2/change_detection
    angular2/bootstrap (except for dart users)
    angular2/render
    angular2/metadata
    angular2/debug
    angular2/pipes
Closes #3977
2015-09-05 07:01:34 +00:00

65 lines
1.8 KiB
TypeScript

/**
* @module
* @description
* Common directives shipped with Angular.
*/
import {CONST_EXPR, Type} from './facade/lang';
import {NgClass} from './directives/ng_class';
import {NgFor} from './directives/ng_for';
import {NgIf} from './directives/ng_if';
import {NgNonBindable} from './directives/ng_non_bindable';
import {NgSwitch, NgSwitchWhen, NgSwitchDefault} from './directives/ng_switch';
export * from './directives/ng_class';
export * from './directives/ng_for';
export * from './directives/ng_if';
export * from './directives/ng_non_bindable';
export * from './directives/ng_style';
export * from './directives/ng_switch';
/**
* A collection of the Angular core directives that are likely to be used in each and every Angular
* application.
*
* This collection can be used to quickly enumerate all the built-in directives in the `@View`
* annotation. For example,
* instead of writing:
*
* ```
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/angular2';
* import {OtherDirective} from 'myDirectives';
*
* @Component({
* selector: 'my-component'
* })
* @View({
* templateUrl: 'myComponent.html',
* directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
* one could import all the core directives at once:
*
* ```
* import {CORE_DIRECTIVES} from 'angular2/angular2';
* import {OtherDirective} from 'myDirectives';
*
* @Component({
* selector: 'my-component'
* })
* @View({
* templateUrl: 'myComponent.html',
* directives: [CORE_DIRECTIVES, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
*
*/
export const CORE_DIRECTIVES: Type[] =
CONST_EXPR([NgClass, NgFor, NgIf, NgNonBindable, NgSwitch, NgSwitchWhen, NgSwitchDefault]);