From a87ebb28e243b87ec74d2c6541ec5094a3273ab4 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Tue, 22 Sep 2015 14:27:27 +0200 Subject: [PATCH] docs(CORE_DIRECTIVES): improve docs for CORE_DIRECTIVES Closes #4310 --- modules/angular2/src/core/directives.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/angular2/src/core/directives.ts b/modules/angular2/src/core/directives.ts index 745a473b53..131b4675fb 100644 --- a/modules/angular2/src/core/directives.ts +++ b/modules/angular2/src/core/directives.ts @@ -22,16 +22,19 @@ export * from './directives/observable_list_diff'; /** - * A collection of the Angular core directives that are likely to be used in each and every Angular + * 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 `@View` - * annotation. For example, - * instead of writing: + * This collection can be used to quickly enumerate all the built-in directives in the `directives` + * property of the `@View` annotation. * - * ``` + * ### Example ([live demo](http://plnkr.co/edit/yakGwpCdUkg0qfzX5m8g?p=preview)) + * + * Instead of writing: + * + * ```typescript * import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/angular2'; - * import {OtherDirective} from 'myDirectives'; + * import {OtherDirective} from './myDirectives'; * * @Component({ * selector: 'my-component' @@ -46,9 +49,9 @@ export * from './directives/observable_list_diff'; * ``` * one could import all the core directives at once: * - * ``` + * ```typescript * import {CORE_DIRECTIVES} from 'angular2/angular2'; - * import {OtherDirective} from 'myDirectives'; + * import {OtherDirective} from './myDirectives'; * * @Component({ * selector: 'my-component' @@ -61,7 +64,6 @@ export * from './directives/observable_list_diff'; * ... * } * ``` - * */ export const CORE_DIRECTIVES: Type[] = CONST_EXPR( [NgClass, NgFor, NgIf, NgNonBindable, NgStyle, NgSwitch, NgSwitchWhen, NgSwitchDefault]);