Project

General

Profile

1
/**
2
 * @license
3
 * Copyright Google Inc. All Rights Reserved.
4
 *
5
 * Use of this source code is governed by an MIT-style license that can be
6
 * found in the LICENSE file at https://angular.io/license
7
 */
8
/**
9
 * To create a Pipe, you must implement this interface.
10
 *
11
 * Angular invokes the `transform` method with the value of a binding
12
 * as the first argument, and any parameters as the second argument in list form.
13
 *
14
 * ## Syntax
15
 *
16
 * `value | pipeName[:arg0[:arg1...]]`
17
 *
18
 * ### Example ([live demo](http://plnkr.co/edit/f5oyIked9M2cKzvZNKHV?p=preview))
19
 *
20
 * The `RepeatPipe` below repeats the value as many times as indicated by the first argument:
21
 *
22
 * ```
23
 * import {Pipe, PipeTransform} from '@angular/core';
24
 *
25
 * @Pipe({name: 'repeat'})
26
 * export class RepeatPipe implements PipeTransform {
27
 *   transform(value: any, times: number) {
28
 *     return value.repeat(times);
29
 *   }
30
 * }
31
 * ```
32
 *
33
 * Invoking `{{ 'ok' | repeat:3 }}` in a template produces `okokok`.
34
 *
35
 * @stable
36
 */
37
export interface PipeTransform {
38
    transform(value: any, ...args: any[]): any;
39
}
(5-5/5)