/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Provider} from '@angular/core'; import {CORE_DIRECTIVES} from './directives'; /** * 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` decorator. * * ### Example * * Instead of writing: * * ```typescript * import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm} from * '@angular/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: * * ```typescript * import {COMMON_DIRECTIVES} from '@angular/common'; * import {OtherDirective} from './myDirectives'; * * @Component({ * selector: 'my-component', * templateUrl: 'myComponent.html', * directives: [COMMON_DIRECTIVES, OtherDirective] * }) * export class MyComponent { * ... * } * ``` * * @experimental Contains forms which are experimental. */ export const COMMON_DIRECTIVES: any[] = CORE_DIRECTIVES;