From 46ba7f69dd430a53eb5a093cf3c932322638b7bf Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Thu, 29 Mar 2018 11:08:56 +0100 Subject: [PATCH] docs(common): migrate `@howToUse` tags (#23062) In pipes the content of these tags is now generated automatically. In directives these tags have been converted to `@usageNotes` tags, but in the future me might find a way to generate that usage too. PR Close #23062 --- packages/common/src/directives/ng_class.ts | 2 +- packages/common/src/directives/ng_plural.ts | 4 ++-- packages/common/src/directives/ng_style.ts | 2 +- packages/common/src/directives/ng_switch.ts | 6 +++--- packages/common/src/directives/ng_template_outlet.ts | 2 +- packages/common/src/pipes/async_pipe.ts | 1 - packages/common/src/pipes/date_pipe.ts | 1 - packages/common/src/pipes/deprecated/date_pipe.ts | 1 - packages/common/src/pipes/deprecated/number_pipe.ts | 3 --- packages/common/src/pipes/i18n_plural_pipe.ts | 1 - packages/common/src/pipes/i18n_select_pipe.ts | 1 - packages/common/src/pipes/json_pipe.ts | 1 - packages/common/src/pipes/number_pipe.ts | 3 --- packages/common/src/pipes/slice_pipe.ts | 1 - 14 files changed, 8 insertions(+), 21 deletions(-) diff --git a/packages/common/src/directives/ng_class.ts b/packages/common/src/directives/ng_class.ts index 1eae99666f..d28cdbb4df 100644 --- a/packages/common/src/directives/ng_class.ts +++ b/packages/common/src/directives/ng_class.ts @@ -13,7 +13,7 @@ import {Directive, DoCheck, ElementRef, Input, IterableChanges, IterableDiffer, * * @whatItDoes Adds and removes CSS classes on an HTML element. * - * @howToUse + * @usageNotes * ``` * ... * diff --git a/packages/common/src/directives/ng_plural.ts b/packages/common/src/directives/ng_plural.ts index f82479aa5f..d8dfca4f06 100644 --- a/packages/common/src/directives/ng_plural.ts +++ b/packages/common/src/directives/ng_plural.ts @@ -18,7 +18,7 @@ import {SwitchView} from './ng_switch'; * * @whatItDoes Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization. * - * @howToUse + * @usageNotes * ``` * * there is nothing @@ -86,7 +86,7 @@ export class NgPlural { * @whatItDoes Creates a view that will be added/removed from the parent {@link NgPlural} when the * given expression matches the plural expression according to CLDR rules. * - * @howToUse + * @usageNotes * ``` * * ... diff --git a/packages/common/src/directives/ng_style.ts b/packages/common/src/directives/ng_style.ts index d048f9774d..4f2f5a44a6 100644 --- a/packages/common/src/directives/ng_style.ts +++ b/packages/common/src/directives/ng_style.ts @@ -13,7 +13,7 @@ import {Directive, DoCheck, ElementRef, Input, KeyValueChanges, KeyValueDiffer, * * @whatItDoes Update an HTML element styles. * - * @howToUse + * @usageNotes * ``` * ... * diff --git a/packages/common/src/directives/ng_switch.ts b/packages/common/src/directives/ng_switch.ts index 1e7f10d8ff..44943c65b2 100644 --- a/packages/common/src/directives/ng_switch.ts +++ b/packages/common/src/directives/ng_switch.ts @@ -39,7 +39,7 @@ export class SwitchView { * @whatItDoes Adds / removes DOM sub-trees when the nest match expressions matches the switch * expression. * - * @howToUse + * @usageNotes * ``` * * ... @@ -133,7 +133,7 @@ export class NgSwitch { * given expression evaluate to respectively the same/different value as the switch * expression. * - * @howToUse + * @usageNotes * ``` * * ... @@ -173,7 +173,7 @@ export class NgSwitchCase implements DoCheck { * match the * switch expression. * - * @howToUse + * @usageNotes * ``` * * ... diff --git a/packages/common/src/directives/ng_template_outlet.ts b/packages/common/src/directives/ng_template_outlet.ts index f653503b62..641f4bf4d6 100644 --- a/packages/common/src/directives/ng_template_outlet.ts +++ b/packages/common/src/directives/ng_template_outlet.ts @@ -13,7 +13,7 @@ import {Directive, EmbeddedViewRef, Input, OnChanges, SimpleChange, SimpleChange * * @whatItDoes Inserts an embedded view from a prepared `TemplateRef` * - * @howToUse + * @usageNotes * ``` * * ``` diff --git a/packages/common/src/pipes/async_pipe.ts b/packages/common/src/pipes/async_pipe.ts index 1332251df1..108e90a1c1 100644 --- a/packages/common/src/pipes/async_pipe.ts +++ b/packages/common/src/pipes/async_pipe.ts @@ -43,7 +43,6 @@ const _observableStrategy = new ObservableStrategy(); /** * @ngModule CommonModule * @whatItDoes Unwraps a value from an asynchronous primitive. - * @howToUse `observable_or_promise_expression | async` * @description * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for diff --git a/packages/common/src/pipes/date_pipe.ts b/packages/common/src/pipes/date_pipe.ts index da00c9ca9b..0469530c7c 100644 --- a/packages/common/src/pipes/date_pipe.ts +++ b/packages/common/src/pipes/date_pipe.ts @@ -14,7 +14,6 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; /** * @ngModule CommonModule * @whatItDoes Uses the function {@link formatDate} to format a date according to locale rules. - * @howToUse `date_expression | date[:format[:timezone[:locale]]]` * @description * * Where: diff --git a/packages/common/src/pipes/deprecated/date_pipe.ts b/packages/common/src/pipes/deprecated/date_pipe.ts index 7cbd954cc0..38c990ea37 100644 --- a/packages/common/src/pipes/deprecated/date_pipe.ts +++ b/packages/common/src/pipes/deprecated/date_pipe.ts @@ -14,7 +14,6 @@ import {DateFormatter} from './intl'; /** * @ngModule CommonModule * @whatItDoes Formats a date according to locale rules. - * @howToUse `date_expression | date[:format]` * @description * * Where: diff --git a/packages/common/src/pipes/deprecated/number_pipe.ts b/packages/common/src/pipes/deprecated/number_pipe.ts index 492501bd38..f87991ff93 100644 --- a/packages/common/src/pipes/deprecated/number_pipe.ts +++ b/packages/common/src/pipes/deprecated/number_pipe.ts @@ -62,7 +62,6 @@ function formatNumber( /** * @ngModule CommonModule * @whatItDoes Formats a number according to locale rules. - * @howToUse `number_expression | number[:digitInfo]` * * Formats a number as text. Group sizing and separator and other locale-specific * configurations are based on the active locale. @@ -99,7 +98,6 @@ export class DeprecatedDecimalPipe implements PipeTransform { /** * @ngModule CommonModule * @whatItDoes Formats a number as a percentage according to locale rules. - * @howToUse `number_expression | percent[:digitInfo]` * * @description * @@ -129,7 +127,6 @@ export class DeprecatedPercentPipe implements PipeTransform { /** * @ngModule CommonModule * @whatItDoes Formats a number as currency using locale rules. - * @howToUse `number_expression | currency[:currencyCode[:symbolDisplay[:digitInfo]]]` * @description * * Use `currency` to format a number as currency. diff --git a/packages/common/src/pipes/i18n_plural_pipe.ts b/packages/common/src/pipes/i18n_plural_pipe.ts index 7f2dd640ad..e7f904102e 100644 --- a/packages/common/src/pipes/i18n_plural_pipe.ts +++ b/packages/common/src/pipes/i18n_plural_pipe.ts @@ -15,7 +15,6 @@ const _INTERPOLATION_REGEXP: RegExp = /#/g; /** * @ngModule CommonModule * @whatItDoes Maps a value to a string that pluralizes the value according to locale rules. - * @howToUse `expression | i18nPlural:mapping[:locale]` * @description * * Where: diff --git a/packages/common/src/pipes/i18n_select_pipe.ts b/packages/common/src/pipes/i18n_select_pipe.ts index 84a44e4426..91f9d96ee6 100644 --- a/packages/common/src/pipes/i18n_select_pipe.ts +++ b/packages/common/src/pipes/i18n_select_pipe.ts @@ -12,7 +12,6 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; /** * @ngModule CommonModule * @whatItDoes Generic selector that displays the string that matches the current value. - * @howToUse `expression | i18nSelect:mapping` * @description * * Where `mapping` is an object that indicates the text that should be displayed diff --git a/packages/common/src/pipes/json_pipe.ts b/packages/common/src/pipes/json_pipe.ts index 887c830786..ed072c9ff1 100644 --- a/packages/common/src/pipes/json_pipe.ts +++ b/packages/common/src/pipes/json_pipe.ts @@ -11,7 +11,6 @@ import {Pipe, PipeTransform} from '@angular/core'; /** * @ngModule CommonModule * @whatItDoes Converts value into JSON string. - * @howToUse `expression | json` * @description * * Converts value into string using `JSON.stringify`. Useful for debugging. diff --git a/packages/common/src/pipes/number_pipe.ts b/packages/common/src/pipes/number_pipe.ts index 824b15f4aa..11f9b0f644 100644 --- a/packages/common/src/pipes/number_pipe.ts +++ b/packages/common/src/pipes/number_pipe.ts @@ -14,7 +14,6 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; /** * @ngModule CommonModule * @whatItDoes Uses the function {@link formatNumber} to format a number according to locale rules. - * @howToUse `number_expression | number[:digitInfo[:locale]]` * @description * * Formats a number as text. Group sizing and separator and other locale-specific @@ -58,7 +57,6 @@ export class DecimalPipe implements PipeTransform { * @ngModule CommonModule * @whatItDoes Uses the function {@link formatPercent} to format a number as a percentage according * to locale rules. - * @howToUse `number_expression | percent[:digitInfo[:locale]]` * @description * * Formats a number as percentage. @@ -97,7 +95,6 @@ export class PercentPipe implements PipeTransform { * @ngModule CommonModule * @whatItDoes Uses the functions {@link getCurrencySymbol} and {@link formatCurrency} to format a * number as currency using locale rules. - * @howToUse `number_expression | currency[:currencyCode[:display[:digitInfo[:locale]]]]` * @description * * Use `currency` to format a number as currency. diff --git a/packages/common/src/pipes/slice_pipe.ts b/packages/common/src/pipes/slice_pipe.ts index 6466d26b1f..06549f0ff0 100644 --- a/packages/common/src/pipes/slice_pipe.ts +++ b/packages/common/src/pipes/slice_pipe.ts @@ -12,7 +12,6 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; /** * @ngModule CommonModule * @whatItDoes Creates a new List or String containing a subset (slice) of the elements. - * @howToUse `array_or_string_expression | slice:start[:end]` * @description * * Where the input expression is a `List` or `String`, and: