COMMON_DIRECTIVES

export COMMON_DIRECTIVES : Type[][]

exported from angular2/common defined in angular2/src/common/common_directives.ts (line 49)

A collection of Angular core directives that are likely to be used in each and every Angular application. This includes core directives (e.g., NgIf and NgFor), and forms directives (e.g., NgModel).

This collection can be used to quickly enumerate all the built-in directives in the directives property of the @Component or @View decorators.

Example

Instead of writing:

import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm} from 'angular2/common'; import {OtherDirective} from './myDirectives'; @Component({ selector: 'my-component', templateUrl: 'myComponent.html', directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm, OtherDirective] }) export class MyComponent { ... }

one could import all the common directives at once:

import {COMMON_DIRECTIVES} from 'angular2/common';
import {OtherDirective} from './myDirectives';

@Component({
  selector: 'my-component',
  templateUrl: 'myComponent.html',
  directives: [COMMON_DIRECTIVES, OtherDirective]
})
export class MyComponent {
  ...
}