CORE_DIRECTIVES

export CORE_DIRECTIVES : Type[]

exported from angular2/common defined in angular2/src/common/directives/core_directives.ts (line 48)

A collection of 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 directives property of the @View annotation.

Example (live demo)

Instead of writing:

import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/common'; import {OtherDirective} from './myDirectives'; @Component({ selector: 'my-component', 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/common';
import {OtherDirective} from './myDirectives';

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