From aafd870b69ba38bad51ce7ad839c964e9631a8ed Mon Sep 17 00:00:00 2001 From: naomi black Date: Mon, 12 May 2014 15:56:29 -0700 Subject: [PATCH 01/13] docs(directive): edit directive class definitions --- lib/directive/a_href.dart | 17 ++++--- lib/directive/ng_model.dart | 96 ++++++++++++++++++++++--------------- 2 files changed, 65 insertions(+), 48 deletions(-) diff --git a/lib/directive/a_href.dart b/lib/directive/a_href.dart index 0241dfbb6..0f875dcf2 100644 --- a/lib/directive/a_href.dart +++ b/lib/directive/a_href.dart @@ -1,17 +1,16 @@ part of angular.directive; /** - * @ngdoc directive - * @name ng.directive:a - * @restrict E + * Modifies the default behavior of the HTML `` element to allow for data binding. * - * @description - * Modifies the default behavior of the html A tag so that the default action is - * prevented when the a href is empty or it contains `ng-click` directive. + * When an `href` tag is empty, or when used with `ng-click`, this directive intercepts and + * modifies the default behavior of the `` element. This change permits the easy + * creation of action links with the [OnClick] directive, without changing the location or causing + * a page reload. * - * This change permits the easy creation of action links with the `ngClick` - * directive without changing the location or causing page reloads, e.g.: - * `Save` +* Example: + * + * Save */ @Decorator(selector: 'a[href]') class AHref { diff --git a/lib/directive/ng_model.dart b/lib/directive/ng_model.dart index b3c9e5564..10377b3fb 100644 --- a/lib/directive/ng_model.dart +++ b/lib/directive/ng_model.dart @@ -263,6 +263,10 @@ class NgModel extends NgControl implements AttachAware { } /** + * + * Creates a two-way databinding between the `ng-model` expression + * and the checkbox input element state. + * * Usage: * * * - * This creates a two way databinding between the `ng-model` expression - * and the checkbox input element state. + * If the optional `ng-true-value` is absent, + * - if the model expression evaluates to true or to a nonzero [:num:], + * then the checkbox is checked + * - otherwise, the checkbox is unchecked * - * If the optional `ng-true-value` is absent then: if the model expression - * evaluates to true or to a nonzero [:num:], then the checkbox is checked; - * otherwise, it is unchecked. + * If `ng-true-value="t_expr"` is present, + * - if the model expression evaluates to the same value as `t_expr`, then the checkbox is checked + * - otherwise, it is unchecked. * - * If `ng-true-value="t_expr"` is present, then: if the model expression - * evaluates to the same value as `t_expr` then the checkbox is checked; - * otherwise, it is unchecked. + * When the checkbox is checked, + * - the model is set to the value of `t_expr` if present + * - otherwise, the model is set to `true` * - * When the checkbox is checked, the model is set to the value of `t_expr` if - * present, true otherwise. When unchecked, it is set to the value of - * `f_expr` if present, false otherwise. + * When the checkbox is unchecked, + * - the model is set to the value of `f_expr` if present + * - otherwise, the model is set to false. * * Also see [NgTrueValue] and [NgFalseValue]. */ @@ -318,16 +324,18 @@ class InputCheckbox { /** + * Creates a two-way databinding between the `ng-model` expression + * and the `` or ` * - * This creates a two-way binding between any string-based input element - * (both `` and ` * - * When the ng-model attribute is present on the input element, + * When the `ng-model` attribute is present on the input element, * and the value of the input element changes, the matching model property on the scope * is updated. Likewise, if the value of the model property changes on the scope, * the value of the input element is updated. @@ -759,10 +758,10 @@ class NgFalseValue { * * * - * - If the ng-model value corresponds to one of the radio elements, that input element will be + * - If the `ng-model` value corresponds to one of the radio elements, that input element will be * selected. - * - If the ng-model value doesn't correspond to any of the radio elements, then none of - * the radio elements will be selected. + * - If the `ng-model` value doesn't correspond to any of the radio elements, then none of + * the radio elements will be selected. * - When a radio button element is selected, the model is updated with its value. * * Radio buttons that do not have a `name` attribute set will have a unique `name` assigned to From 245db29fbad6e0fa115467d2f80f81408ed598c3 Mon Sep 17 00:00:00 2001 From: naomi black Date: Tue, 6 May 2014 19:18:29 -0700 Subject: [PATCH 04/13] docs(formatter): improvements to currency, date, filter, and formatter library --- lib/core/annotation_src.dart | 7 +++++-- lib/formatter/currency.dart | 2 +- lib/formatter/date.dart | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/core/annotation_src.dart b/lib/core/annotation_src.dart index 643339ca9..98664729a 100644 --- a/lib/core/annotation_src.dart +++ b/lib/core/annotation_src.dart @@ -547,8 +547,11 @@ abstract class DetachAware { } /** - * Use @[Formatter] annotation to register a new formatter. A formatter is a class - * with a [call] method (a callable function). + * Use the @[Formatter] class annotation to register a new formatter. + * + * A formatter is a pure function that performs a transformation on input data from an expression. + * For more on formatters in Angular, see the documentation for the + * [angular:formatter](#angular-formatter) library. * * Usage: * diff --git a/lib/formatter/currency.dart b/lib/formatter/currency.dart index b71c0fa10..a5829b304 100644 --- a/lib/formatter/currency.dart +++ b/lib/formatter/currency.dart @@ -1,7 +1,7 @@ part of angular.formatter_internal; /** - * Formats a number as a currency (for example $1,234.56). + * Formats a number as a currency (for example 1,234.56$). * * When no currency symbol is provided, '$' is used. For more on formatters, * see the [angular:formatter](#angular-formatter) library. diff --git a/lib/formatter/date.dart b/lib/formatter/date.dart index 372217f04..abdd4e766 100644 --- a/lib/formatter/date.dart +++ b/lib/formatter/date.dart @@ -23,7 +23,7 @@ part of angular.formatter_internal; * * * For more on explicit formatting of dates and date syntax, see the documentation for the - * [DartFormat class](http://api.dartlang.org/docs/releases/latest/intl/DateFormat.html). + * [DartFormat class](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/intl/intl.DateFormat). * */ @Formatter(name:'date') From c357e47d64fc76f7ffee10049fbb1010d09a00d2 Mon Sep 17 00:00:00 2001 From: naomi black Date: Mon, 12 May 2014 12:36:06 -0700 Subject: [PATCH 05/13] docs: edit formatter docs --- lib/formatter/json.dart | 5 +++-- lib/formatter/limit_to.dart | 32 ++++++++++++++++++++------------ lib/formatter/lowercase.dart | 2 +- lib/formatter/number.dart | 14 ++++++++------ lib/formatter/order_by.dart | 36 ++++++++++++++++++++++++++++++++---- lib/formatter/stringify.dart | 4 ++-- lib/formatter/uppercase.dart | 2 +- 7 files changed, 67 insertions(+), 28 deletions(-) diff --git a/lib/formatter/json.dart b/lib/formatter/json.dart index 8bc45666d..7799f98fb 100644 --- a/lib/formatter/json.dart +++ b/lib/formatter/json.dart @@ -1,8 +1,9 @@ part of angular.formatter_internal; /** - * Allows you to convert a JavaScript object into JSON string. This formatter is - * mostly useful for debugging. + * Converts a JavaScript object into a JSON string. + * + * This formatter is mostly useful for debugging. * * Usage: * diff --git a/lib/formatter/limit_to.dart b/lib/formatter/limit_to.dart index a38467f61..03cc90445 100644 --- a/lib/formatter/limit_to.dart +++ b/lib/formatter/limit_to.dart @@ -2,20 +2,28 @@ part of angular.formatter_internal; /** * Creates a new List or String containing only a prefix/suffix of the - * elements as specified by the `limit` parameter. + * elements. + * + * The number of elements to return is specified by the `limitTo` parameter. + * + * Usage: + * + * {{ expression | limitTo:_value_ }} * - * When operating on a List, the returned list is always a copy even when all - * the elements are being returned. * - * When the `limit` expression evaluates to a positive integer, `limit` items - * from the beginning of the List/String are returned. When `limit` evaluates - * to a negative integer, `|limit|` items from the end of the List/String are - * returned. If `|limit|` is larger than the size of the List/String, then the - * entire List/String is returned. In the case of a List, a copy of the list is - * returned. + *
{{item}}
* - * If the `limit` expression evaluates to a null or non-integer, then an empty - * list is returned. If the input is a null List/String, a null is returned. + * + * Where the input expression is a [List] or [String], and `limitTo` evaluates to: + * + * - **a positive integer**: return _value_ items from the beginning of the list or string + * expression. + * - **a negative integer**: return _value_ items from the end of the list or string expression. + * - **null or non-integer**: return an empty list or string. + * - **`|limitTo|` greater than the size of the expression**: return the entire expression. + * + * When operating on a [List], the returned list is always a copy even when all + * the elements are being returned. * * Example: * @@ -29,7 +37,7 @@ part of angular.formatter_internal; * *
  • {{i}}
  • * - * results in + * produces the following: * *
  • i
  • *
  • j
  • diff --git a/lib/formatter/lowercase.dart b/lib/formatter/lowercase.dart index 004a837f5..c00b4ace4 100644 --- a/lib/formatter/lowercase.dart +++ b/lib/formatter/lowercase.dart @@ -1,7 +1,7 @@ part of angular.formatter_internal; /** - * Converts string to lowercase. + * Converts a string to lowercase. * * Usage: * diff --git a/lib/formatter/number.dart b/lib/formatter/number.dart index 1cb2514b6..6dd39ae15 100644 --- a/lib/formatter/number.dart +++ b/lib/formatter/number.dart @@ -3,7 +3,7 @@ part of angular.formatter_internal; /** * Formats a number as text. * - * If the input is not a number an empty string is returned. + * If the input is not a number, an empty string is returned. * * * Usage: @@ -17,12 +17,14 @@ class Number { var _nfs = new Map>(); /** - * [value]: the value to format + * Format a number as text. + * + * - `value`: the value to format + * - `fractionSize`: Number of decimal places to round the number to. + * + * When fractionSize is not provided, fraction size is computed from the current locale's number + * formatting pattern. In the case of the default locale, it will be 3. * - * [fractionSize]: Number of decimal places to round the number to. If this - * is not provided then the fraction size is computed from the current - * locale's number formatting pattern. In the case of the default locale, - * it will be 3. */ call(value, [fractionSize = null]) { if (value is String) value = double.parse(value); diff --git a/lib/formatter/order_by.dart b/lib/formatter/order_by.dart index 739433d5d..25cae8b94 100644 --- a/lib/formatter/order_by.dart +++ b/lib/formatter/order_by.dart @@ -3,7 +3,32 @@ part of angular.formatter_internal; typedef dynamic _Mapper(dynamic e); /** - * Orders the provided [Iterable] by the `expression` predicate. + * Orders the the elements of an object by a predicate expression. + * + * Usage: + * + *
    + * + * + * The input must be an [Iterable] object. The expression may be specified as: + * + * - `+`: sort the elements in asending order. This is the default comparator. + * - `-`: sort the elements in descending order. + * - **a string expression**: sort on a decorated/transformed value, such as "lastName", + * or to sort non-primitives values. + * - **a custom callable expression**: an expression that will be called to transform the element + * before a sort. + * - **a list**: the list may consist of either string or callable expressions. A list expression + * indicates a list of fallback expressions to use when a comparision results in the items + * being equal. + * + * If the expression is explicitly empty(`orderBy:```), the elements are sorted in + * ascending order, using the default comparator, `+`. + * + * Last, by appending `:true`, you can set "descending order" to true, + * which has the same effect as the `-` comparator. + * + * # Examples * * Example 1: Simple array and single/empty expression. * @@ -24,7 +49,7 @@ typedef dynamic _Mapper(dynamic e); *
      * * The empty string expression, `''`, here signifies sorting in ascending order - * using the default comparator. Using `'+'` would also work as the `+` prefix + * using the default comparator. Using `'+'` would also work, as the `+` prefix * is implied. * * To sort in descending order, you would use the `'-'` prefix. @@ -44,7 +69,7 @@ typedef dynamic _Mapper(dynamic e); * * Example 2: Complex objects, single expression. * - * You may provide a more complex expression to sort non-primitives values or + * You may provide a more complex expression to sort non-primitive values or * if you want to sort on a decorated/transformed value. * * e.g. Support you have a list `users` that looks like this: @@ -135,7 +160,10 @@ class OrderBy implements Function { } /** - * expression: String/Function or Array of String/Function. + * Order a list by expression. + * + * - `expression`: String/Function or Array of String/Function. + * - `descending`: When specified, use descending order. (The default is ascending order.) */ List call(List items, var expression, [bool descending=false]) { if (items == null) { diff --git a/lib/formatter/stringify.dart b/lib/formatter/stringify.dart index 439bfc645..a1bc8ea3f 100644 --- a/lib/formatter/stringify.dart +++ b/lib/formatter/stringify.dart @@ -1,9 +1,9 @@ part of angular.formatter_internal; /** - * Allows you to convert an object to a string. + * Converts an object to a string. * - * Null object are converted to an empty string. + * Null objects are converted to an empty string. * * * Usage: diff --git a/lib/formatter/uppercase.dart b/lib/formatter/uppercase.dart index 722170d2f..f47b56b01 100644 --- a/lib/formatter/uppercase.dart +++ b/lib/formatter/uppercase.dart @@ -1,7 +1,7 @@ part of angular.formatter_internal; /** - * Converts string to uppercase. + * Converts a string to uppercase. * * Usage: * From caa82f073c7ed675a09c24fce3b8e3b67aaed0b2 Mon Sep 17 00:00:00 2001 From: naomi black Date: Mon, 12 May 2014 14:21:40 -0700 Subject: [PATCH 06/13] docs(formatter): fix "leading" in currency and edits to limit_to --- lib/formatter/currency.dart | 5 +++-- lib/formatter/limit_to.dart | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/formatter/currency.dart b/lib/formatter/currency.dart index a5829b304..bc1f641ba 100644 --- a/lib/formatter/currency.dart +++ b/lib/formatter/currency.dart @@ -1,7 +1,7 @@ part of angular.formatter_internal; /** - * Formats a number as a currency (for example 1,234.56$). + * Formats a number as a currency (for example $1,234.56). * * When no currency symbol is provided, '$' is used. For more on formatters, * see the [angular:formatter](#angular-formatter) library. @@ -22,7 +22,8 @@ class Currency implements Function { * * - `value`: the value to format as currency. * - `symbol`: the currency symbol to use. If no symbol is specified, `$` is used. - * - `leading`: places the symbol in front of the number instead of following it. + * - `leading`: when set to false, places the symbol after the number instead of before + * it. */ call(value, [symbol = r'$', leading = true]) { if (value is String) value = double.parse(value); diff --git a/lib/formatter/limit_to.dart b/lib/formatter/limit_to.dart index 03cc90445..b2071e1e3 100644 --- a/lib/formatter/limit_to.dart +++ b/lib/formatter/limit_to.dart @@ -8,19 +8,19 @@ part of angular.formatter_internal; * * Usage: * - * {{ expression | limitTo:_value_ }} + * {{ expression | limitTo:_number_ }} * * - *
      {{item}}
      + *
      {{item}}
      * * - * Where the input expression is a [List] or [String], and `limitTo` evaluates to: + * Where the input expression is a [List] or [String], and `limitTo` is: * - * - **a positive integer**: return _value_ items from the beginning of the list or string + * - **a positive integer**: return _number_ items from the beginning of the list or string * expression. - * - **a negative integer**: return _value_ items from the end of the list or string expression. - * - **null or non-integer**: return an empty list or string. + * - **a negative integer**: return _number_ items from the end of the list or string expression. * - **`|limitTo|` greater than the size of the expression**: return the entire expression. + * - **null** or all other cases: return an empty list or string. * * When operating on a [List], the returned list is always a copy even when all * the elements are being returned. From 16478afb98be12fa6dc717e1ca838c872408c01e Mon Sep 17 00:00:00 2001 From: naomi black Date: Wed, 14 May 2014 10:20:26 -0700 Subject: [PATCH 07/13] docs(formatter): fix and edit per comments on 0e0f8d6 --- lib/formatter/currency.dart | 4 ++-- lib/formatter/json.dart | 7 ++++++- lib/formatter/module.dart | 3 --- lib/formatter/module_internal.dart | 6 ++++++ lib/formatter/number.dart | 2 +- lib/formatter/order_by.dart | 2 +- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/formatter/currency.dart b/lib/formatter/currency.dart index bc1f641ba..d0b7e8bff 100644 --- a/lib/formatter/currency.dart +++ b/lib/formatter/currency.dart @@ -9,7 +9,7 @@ part of angular.formatter_internal; * * Usage: * - * {{ numeric_expression | currency[:symbol[:leading]] }} + * {{ numeric_expression | currency[:symbol[:leading=false]] }} * */ @Formatter(name:'currency') @@ -23,7 +23,7 @@ class Currency implements Function { * - `value`: the value to format as currency. * - `symbol`: the currency symbol to use. If no symbol is specified, `$` is used. * - `leading`: when set to false, places the symbol after the number instead of before - * it. + * it. (By default, leading is set to true.) */ call(value, [symbol = r'$', leading = true]) { if (value is String) value = double.parse(value); diff --git a/lib/formatter/json.dart b/lib/formatter/json.dart index 7799f98fb..cf0ab172b 100644 --- a/lib/formatter/json.dart +++ b/lib/formatter/json.dart @@ -1,10 +1,15 @@ part of angular.formatter_internal; /** - * Converts a JavaScript object into a JSON string. + * Converts an object into a JSON string. * * This formatter is mostly useful for debugging. * + * Note that the object to convert must be directly encodable to JSON, that is, a + * number, boolean, string, null, list or a map with string keys). To convert other objects, the + * [toEncodable](https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart-convert + * .JsonCodec#id_encode) function must be used first. + * * Usage: * * {{ json_expression | json }} diff --git a/lib/formatter/module.dart b/lib/formatter/module.dart index 9859a14ff..f668acc10 100644 --- a/lib/formatter/module.dart +++ b/lib/formatter/module.dart @@ -1,5 +1,4 @@ /** - * * Formatters for [angular.dart](#angular/angular), a web framework for Dart. A formatter is a * pure function that performs a transformation on input data from an expression. * @@ -18,8 +17,6 @@ * or, in a repeater: * *
      - * - * */ library angular.formatter; diff --git a/lib/formatter/module_internal.dart b/lib/formatter/module_internal.dart index 14a27d353..d13aa500e 100644 --- a/lib/formatter/module_internal.dart +++ b/lib/formatter/module_internal.dart @@ -19,6 +19,12 @@ part 'order_by.dart'; part 'uppercase.dart'; part 'stringify.dart'; +/** + * This module registers all the Angular formatters. + * + * When instantiating an Angular application through applicationFactory, + * FormatterModule is automatically included. + */ class FormatterModule extends Module { FormatterModule() { bind(Arrayify); diff --git a/lib/formatter/number.dart b/lib/formatter/number.dart index 6dd39ae15..831be37bf 100644 --- a/lib/formatter/number.dart +++ b/lib/formatter/number.dart @@ -22,7 +22,7 @@ class Number { * - `value`: the value to format * - `fractionSize`: Number of decimal places to round the number to. * - * When fractionSize is not provided, fraction size is computed from the current locale's number + * When `fractionSize` is not provided, fraction size is computed from the current locale's number * formatting pattern. In the case of the default locale, it will be 3. * */ diff --git a/lib/formatter/order_by.dart b/lib/formatter/order_by.dart index 25cae8b94..fea03dc39 100644 --- a/lib/formatter/order_by.dart +++ b/lib/formatter/order_by.dart @@ -22,7 +22,7 @@ typedef dynamic _Mapper(dynamic e); * indicates a list of fallback expressions to use when a comparision results in the items * being equal. * - * If the expression is explicitly empty(`orderBy:```), the elements are sorted in + * If the expression is explicitly empty(`orderBy:''`), the elements are sorted in * ascending order, using the default comparator, `+`. * * Last, by appending `:true`, you can set "descending order" to true, From f98984720389697a8ee78bd7cbbb6acce3f04c8a Mon Sep 17 00:00:00 2001 From: naomi black Date: Wed, 14 May 2014 19:09:21 -0700 Subject: [PATCH 08/13] docs(InputDateLike): Improve and edit the class description --- lib/directive/ng_model.dart | 54 +++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/lib/directive/ng_model.dart b/lib/directive/ng_model.dart index eb1c5881b..33a4a218c 100644 --- a/lib/directive/ng_model.dart +++ b/lib/directive/ng_model.dart @@ -541,23 +541,18 @@ class NgBindTypeForDateLike { } /** - * **Background: Standards and Browsers** - * - * According to the - * [HTML5 Standard](http://www.w3.org/TR/html5/forms.html#the-input-element), - * the [dom.InputElement.valueAsDate] and [dom.InputElement.valueAsNumber] IDL - * attributes should be available for all date/time related input types, - * except for `datetime-local` which is limited to - * [dom.InputElement.valueNumber]. Of course, all input types support - * [dom.InputElement.value] which yields a [String]; - * [dom.InputElement.valueAsDate] yields a [DateTime] and - * [dom.InputElement.valueNumber] yields a [num]. - * - * But not all browsers currently support date/time related inputs and of - * those that do, some deviate from the standard. Hence, this directive - * allows developers to control the IDL attribute that will be used - * to read the value of a date/time input. This is achieved via the subordinate - * 'ng-bind-type' directive; see [NgBindTypeForDateLike] for details. + * Controls the IDL attribute that reads the value of a date/time input, + * to support browsers that deviate from the HTML5 standard for date/time. + * + * The [HTML5 Standard](http://www.w3.org/TR/html5/forms.html#the-input-element) for date/time + * related inputs specifies that the [dom.InputElement.valueAsDate] and + * [dom.InputElement.valueAsNumber] IDL attributes should be available for all date/time related + * input types, except for `datetime-local` which is limited to [dom.InputElement.valueNumber]. + * + * This directive creates a two-way binding between the input and a model + * property. The subordinate 'ng-bind-type' directive determines which input + * IDL attribute is read (see [NgBindTypeForDateLike] for details) and + * hence the type of the read values. * * **Usage**: * @@ -569,23 +564,24 @@ class NgBindTypeForDateLike { * * dynamic myModel; // one of DateTime | num | String * - * This directive creates a two-way binding between the input and a model - * property. The subordinate 'ng-bind-type' directive determines which input - * IDL attribute is read (see [NgBindTypeForDateLike] for details) and - * hence the type of the read values. The type of the model property value - * determines which IDL attribute is written to: [DateTime] and [num] values - * are assigned to [dom.InputElement.valueAsDate] and - * [dom.InputElement.valueNumber], respectively; [String] and `null` values - * are assigned to [dom.InputElement.value]. Setting the model to `null` will - * clear the input if it is currently valid, otherwise, invalid input is left - * untouched (so that the user has an opportunity to correct it). To clear the - * input unconditionally, set the model property to the empty string (''). + * The type of the model property value determines which IDL attribute is written to: + * + * - `DateTime` values are assigned to `dom.InputElement.valueAsDate` + * - `num` values are assigned to `dom.InputElement.valueAsDate` + * - `String` and `null` values are assigned to `dom.InputElement.value` + * + * Setting the model to `null` will clear the input if it is currently + * valid, otherwise, invalid input is left untouched (so that the user has an opportunity to + * correct it). + * + * To clear the input unconditionally, set the model property to the empty string (`''`). * * **Notes**: + * * - As prescribed by the HTML5 standard, [DateTime] values returned by the * `valueAsDate` IDL attribute are meant to be in UTC. * - As of the HTML5 Editor's Draft 29 March 2014, datetime-local is no longer - * part of the standard. Other date related input are also at risk of being + * part of the standard. Other date-related input are also at risk of being * dropped. */ From 08a89ebaf2cbaaa29224e1b5ff25156024191506 Mon Sep 17 00:00:00 2001 From: naomi black Date: Wed, 14 May 2014 19:18:13 -0700 Subject: [PATCH 09/13] docs(NgTrueValue): Edits for dartdoc style. --- lib/directive/ng_model.dart | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/directive/ng_model.dart b/lib/directive/ng_model.dart index 33a4a218c..8cfb69b7e 100644 --- a/lib/directive/ng_model.dart +++ b/lib/directive/ng_model.dart @@ -668,6 +668,12 @@ class _UidCounter { final _uidCounter = new _UidCounter(); /** + * Binds an expression to the value of a radio element or option, + * to be used when that element is selected. + * + * When the element is selected, the `ng-model` property of that element is set to the bound value. + * Note that `expr` can be any type; i.e., it is not restricted to [String]. + * * Usage: * * @@ -682,8 +688,7 @@ final _uidCounter = new _UidCounter(); * * When present, the value of this `ng-value` one-way attribute is assigned to * the `ng-model` property when the corresponding radio element or option is - * selected. Note that `expr` can be not any type; i.e., it is not restricted - * to [String]. + * selected. */ @Decorator(selector: 'input[type=radio][ng-model][ng-value]') @Decorator(selector: 'option[ng-value]') @@ -704,15 +709,17 @@ class NgValue { } /** + * Assigns the value of a bound expression to the model when an input checkbox is + * checked. + * * Usage: * * * - * The initial value of the expression bound to this directive is assigned to - * the model when the input is checked. Note that the expression can be of any - * type, not just [String]. Also see [InputCheckboxDirective], [NgFalseValue]. + * Note that the expression can be of any type, not just [String]. + * Also see [InputCheckboxDirective], [NgFalseValue]. */ @Decorator(selector: 'input[type=checkbox][ng-model][ng-true-value]') class NgTrueValue { From 229cbc0d6f51e604a30a1cf6d6093d826cdb96fa Mon Sep 17 00:00:00 2001 From: naomi black Date: Wed, 14 May 2014 19:19:22 -0700 Subject: [PATCH 10/13] docs(NgFalseValue): Edits for dartdoc style. --- lib/directive/ng_model.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/directive/ng_model.dart b/lib/directive/ng_model.dart index 8cfb69b7e..e604f1466 100644 --- a/lib/directive/ng_model.dart +++ b/lib/directive/ng_model.dart @@ -733,14 +733,16 @@ class NgTrueValue { } /** + * Assigns the value of a bound expression to the model when an input checkbox is + * unchecked. + * * Usage: * * * - * The initial value of the expression bound to this directive is assigned to - * the model when the input is unchecked. Note that the expression can be of any + * Note that the expression can be of any * type, not just [String]. Also see [InputCheckboxDirective], [NgTrueValue]. */ @Decorator(selector: 'input[type=checkbox][ng-model][ng-false-value]') From 851d699cdaaf361438c0874468c137dffdabdec0 Mon Sep 17 00:00:00 2001 From: naomi black Date: Wed, 14 May 2014 19:29:39 -0700 Subject: [PATCH 11/13] docs(ng-model): Fix typos and style --- lib/directive/ng_model.dart | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/directive/ng_model.dart b/lib/directive/ng_model.dart index e604f1466..5ee779eb3 100644 --- a/lib/directive/ng_model.dart +++ b/lib/directive/ng_model.dart @@ -69,7 +69,7 @@ class NgModel extends NgControl implements AttachAware { } /** - * Resets the model value to it's original (pristine) value. If the model has been interacted + * Resets the model value to its original (pristine) value. If the model has been interacted * with by the user at all then the model will be also reset to an "untouched" state. */ void reset() { @@ -266,7 +266,7 @@ class NgModel extends NgControl implements AttachAware { * Creates a two-way databinding between the `ng-model` expression * and the checkbox input element state. * - * Usage: + * **Usage** * * ` or ` @@ -391,11 +391,11 @@ class InputTextLike { * Creates a two-way databinding between the `ng-model` expression * and a numeric input element. * - * Usage: + * **Usage** * * * - * Model: + * **Model** * * num myModel; * @@ -674,7 +674,7 @@ final _uidCounter = new _UidCounter(); * When the element is selected, the `ng-model` property of that element is set to the bound value. * Note that `expr` can be any type; i.e., it is not restricted to [String]. * - * Usage: + * **Usage** * * * @@ -712,7 +712,7 @@ class NgValue { * Assigns the value of a bound expression to the model when an input checkbox is * checked. * - * Usage: + * **Usage** * * * @@ -809,7 +809,7 @@ class InputRadio { * Creates a two-way databinding between the expression specified in `ng-model` and the HTML element * in the DOM. * - * Usage: + * **Usage** * * * From 2ae9cfd5521bca092c02f751eaaa5c4f0fcc83be Mon Sep 17 00:00:00 2001 From: naomi black Date: Wed, 14 May 2014 21:12:59 -0700 Subject: [PATCH 12/13] docs(ng-bind): Edits for dartdoc format --- lib/directive/ng_bind.dart | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/directive/ng_bind.dart b/lib/directive/ng_bind.dart index 04346cb0e..99af17679 100644 --- a/lib/directive/ng_bind.dart +++ b/lib/directive/ng_bind.dart @@ -1,19 +1,18 @@ part of angular.directive; /** - * The ngBind attribute tells Angular to replace the text content of the - * specified HTML element with the value of a given expression, and to update - * the text content when the value of that expression changes. + * Replaces the text content of the specified HTML element with the value of a given expression, + * and updates the text content when the value of that expression changes. * * Typically, you don't use ngBind directly, but instead you use the double - * curly markup like {{ expression }} which is similar but less verbose. + * curly markup like `{{ expression }}` which is similar but less verbose. * - * It is preferrable to use ngBind instead of {{ expression }} when a template + * It is preferrable to use `ng-bind` instead of `{{ expression }}` when a template * is momentarily displayed by the browser in its raw state before Angular - * compiles it. Since ngBind is an element attribute, it makes the bindings + * compiles it. Since `ng-bind` is an element attribute, it makes the bindings * invisible to the user while the page is loading. * - * An alternative solution to this problem would be using the ngCloak directive. + * An alternative solution to this problem would be using the [ngCloak] directive. */ @Decorator( selector: '[ng-bind]', From 6a20d5c0680265392744e2ba05a789bf7a38fd22 Mon Sep 17 00:00:00 2001 From: naomi black Date: Wed, 14 May 2014 21:13:30 -0700 Subject: [PATCH 13/13] docs(NgModelConverter): Edits for style. --- lib/directive/ng_model.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/directive/ng_model.dart b/lib/directive/ng_model.dart index 5ee779eb3..4571ee8f3 100644 --- a/lib/directive/ng_model.dart +++ b/lib/directive/ng_model.dart @@ -1,10 +1,10 @@ part of angular.directive; /** - * NgModelConverter is the class interface for performing transformations on - * the viewValue and modelValue properties on a model. A new converter can be created - * by implementing the NgModelConverter class and then attaching to a model via the - * provided setter. + * Class interface for performing transformations on the viewValue and modelValue properties on a model. + * + * A new converter can be created by implementing the NgModelConverter class and then attaching to + * a model via the provided setter. */ abstract class NgModelConverter { String get name; @@ -18,6 +18,7 @@ class _NoopModelConverter extends NgModelConverter { /** * Ng-model directive is responsible for reading/writing to the model. + * * The directive itself is headless. (It does not know how to render or what * events to listen for.) It is meant to be used with other directives which * provide the rendering and listening capabilities. The directive itself