
committed by
Kara Erickson

parent
eb999300d9
commit
725bae1921
@ -51,8 +51,9 @@ const _observableStrategy = new ObservableStrategy();
|
||||
* changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid
|
||||
* potential memory leaks.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
* ## Examples
|
||||
* ### Examples
|
||||
*
|
||||
* This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the
|
||||
* promise.
|
||||
@ -64,7 +65,6 @@ const _observableStrategy = new ObservableStrategy();
|
||||
*
|
||||
* {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Pipe({name: 'async', pure: false})
|
||||
export class AsyncPipe implements OnDestroy, PipeTransform {
|
||||
|
@ -64,6 +64,8 @@ import {DateFormatter} from './intl';
|
||||
* - this pipe uses the Internationalization API. Therefore it is only reliable in Chrome and Opera
|
||||
* browsers.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
* ### Examples
|
||||
*
|
||||
* Assuming `dateObj` is (year: 2010, month: 9, day: 3, hour: 12 PM, minute: 05, second: 08)
|
||||
|
@ -78,11 +78,12 @@ function formatNumber(
|
||||
* WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
|
||||
* and may require a polyfill. See [Browser Support](guide/browser-support) for details.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
* ### Example
|
||||
*
|
||||
* {@example common/pipes/ts/number_pipe.ts region='DeprecatedNumberPipe'}
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Pipe({name: 'number'})
|
||||
export class DeprecatedDecimalPipe implements PipeTransform {
|
||||
@ -106,6 +107,8 @@ export class DeprecatedDecimalPipe implements PipeTransform {
|
||||
* WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
|
||||
* and may require a polyfill. See [Browser Support](guide/browser-support) for details.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
* ### Example
|
||||
*
|
||||
* {@example common/pipes/ts/percent_pipe.ts region='DeprecatedPercentPipe'}
|
||||
@ -140,6 +143,8 @@ export class DeprecatedPercentPipe implements PipeTransform {
|
||||
* WARNING: this pipe uses the Internationalization API which is not yet available in all browsers
|
||||
* and may require a polyfill. See [Browser Support](guide/browser-support) for details.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
* ### Example
|
||||
*
|
||||
* {@example common/pipes/ts/currency_pipe.ts region='DeprecatedCurrencyPipe'}
|
||||
|
@ -18,7 +18,9 @@ const _INTERPOLATION_REGEXP: RegExp = /#/g;
|
||||
*
|
||||
* Maps a value to a string that pluralizes the value according to locale rules.
|
||||
*
|
||||
* ## Example
|
||||
* @usageNotes
|
||||
*
|
||||
* ### Example
|
||||
*
|
||||
* {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}
|
||||
*
|
||||
|
@ -18,7 +18,9 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
|
||||
* If none of the keys of the `mapping` match the `value`, then the content
|
||||
* of the `other` key is returned when present, otherwise an empty string is returned.
|
||||
*
|
||||
* ## Example
|
||||
* @usageNotes
|
||||
*
|
||||
* ### Example
|
||||
*
|
||||
* {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}
|
||||
*
|
||||
|
@ -18,9 +18,8 @@ import {Pipe, PipeTransform} from '@angular/core';
|
||||
*
|
||||
* The following component uses a JSON pipe to convert an object
|
||||
* to JSON format, and displays the string in both formats for comparison.
|
||||
|
||||
* {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
|
||||
*
|
||||
* {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
|
||||
*
|
||||
*/
|
||||
@Pipe({name: 'json', pure: false})
|
||||
|
@ -19,20 +19,20 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
|
||||
* formatted according to locale rules that determine group sizing and
|
||||
* separator, decimal-point character, and other locale-specific
|
||||
* configurations.
|
||||
*
|
||||
*
|
||||
* If no parameters are specified, the function rounds off to the nearest value using this
|
||||
* [rounding method](https://en.wikibooks.org/wiki/Arithmetic/Rounding).
|
||||
* The behavior differs from that of the JavaScript ```Math.round()``` function.
|
||||
* In the following case for example, the pipe rounds down where
|
||||
* In the following case for example, the pipe rounds down where
|
||||
* ```Math.round()``` rounds up:
|
||||
*
|
||||
*
|
||||
* ```html
|
||||
* -2.5 | number:'1.0-0'
|
||||
* > -3
|
||||
* Math.round(-2.5)
|
||||
* > -2
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @see `formatNumber()`
|
||||
*
|
||||
* @usageNotes
|
||||
@ -44,7 +44,6 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
|
||||
*
|
||||
* <code-example path="common/pipes/ts/number_pipe.ts" region='NumberPipe'></code-example>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Pipe({name: 'number'})
|
||||
export class DecimalPipe implements PipeTransform {
|
||||
|
@ -15,6 +15,8 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
|
||||
*
|
||||
* Creates a new `Array` or `String` containing a subset (slice) of the elements.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
* All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`
|
||||
* and `String.prototype.slice()`.
|
||||
*
|
||||
@ -31,14 +33,15 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
|
||||
*
|
||||
* produces the following:
|
||||
*
|
||||
* <li>b</li>
|
||||
* <li>c</li>
|
||||
* ```html
|
||||
* <li>b</li>
|
||||
* <li>c</li>
|
||||
* ```
|
||||
*
|
||||
* ## String Examples
|
||||
* ### String Examples
|
||||
*
|
||||
* {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@Pipe({name: 'slice', pure: false})
|
||||
|
Reference in New Issue
Block a user