From 029c0534f3207ba35d035c06c0df1a79c42c25de Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Wed, 4 Nov 2015 17:37:16 +0000 Subject: [PATCH] docs(*): add initial cheatsheet tags --- .../src/common/directives/core_directives.ts | 23 ++++++++ modules/angular2/src/core/application.ts | 55 +++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/modules/angular2/src/common/directives/core_directives.ts b/modules/angular2/src/common/directives/core_directives.ts index f02231a5f9..996348977f 100644 --- a/modules/angular2/src/common/directives/core_directives.ts +++ b/modules/angular2/src/common/directives/core_directives.ts @@ -44,6 +44,29 @@ import {NgSwitch, NgSwitchWhen, NgSwitchDefault} from './ng_switch'; * ... * } * ``` + + * @cheatsheetSection + * Built-in directives + * `import {NgIf, ...} from 'angular2/angular2';` + * @cheatsheetItem + *
+ * Removes or recreates a portion of the DOM tree based on the showSection expression. + * *ng-if + * @cheatsheetItem + *
  • + * Turns the li element and its contents into a template, and uses that to instantiate a view for each item in list. + * '*ng-for' + * @cheatsheetItem + *
    \n \n \n \n
    + * Conditionally swaps the contents of the div by selecting one of the embedded templates based on the current value of conditionExpression. + * [ng-switch] + * [ng-switch-when] + * ng-switch-when + * ng-switch-default + * @cheatsheetItem + *
    + * Binds the presence of css classes on the element to the truthiness of the associated map values. The right-hand side expression should return {class-name: true/false} map. + * [ng-class] */ export const CORE_DIRECTIVES: Type[] = CONST_EXPR([NgClass, NgFor, NgIf, NgStyle, NgSwitch, NgSwitchWhen, NgSwitchDefault]); diff --git a/modules/angular2/src/core/application.ts b/modules/angular2/src/core/application.ts index b275f2210b..9a62425122 100644 --- a/modules/angular2/src/core/application.ts +++ b/modules/angular2/src/core/application.ts @@ -18,6 +18,61 @@ export { } from './application_ref'; /// See [commonBootstrap] for detailed documentation. +/** + * @cheatsheetSection + * Bootstrapping + * `import {bootstrap} from 'angular2/angular2';` + * @cheatsheetItem + * + * Binds property value to the result of expression firstName. + * [value] + * @cheatsheetItem + *
    + * Binds attribute role to the result of expression myAriaRole. + * [attr.role] + * @cheatsheetItem + *
    + * Binds the presence of the css class extra-sparkle on the element to the truthiness of the expression isDelightful. + * [class.extra-sparkle] + * @cheatsheetItem + *
    + * Binds style property width to the result of expression mySize in pixels. Units are optional. + * [style.width.px] + * @cheatsheetItem + *