To create a Pipe, you must implement this interface.
Angular invokes the transform
method with the value of a binding as the
first argument, and any parameters as the second argument in list form.
Syntax
value | pipeName[:arg0[:arg1...]]
Example
The RepeatPipe
below repeats the value as many times as indicated by the
first argument:
import 'package:angular2/core.dart' show Pipe, PipeTransform;
@Pipe(name: 'repeat')
class RepeatPipe implements PipeTransform {
transform(dynamic value, int times) => '$value' * times;
}
Invoking {{ 'ok' | repeat:3 }}
in a template produces okokok
.
Constructors
Properties
- hashCode → int
-
Get a hash code for this object.
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited