65 lines
975 B
Plaintext
65 lines
975 B
Plaintext
|
|
||
|
p.location-badge.
|
||
|
exported from <a href='../pipes'>angular2/pipes</a>
|
||
|
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/change_detection/pipes/json_pipe.ts#L3-L33">angular2/src/change_detection/pipes/json_pipe.ts (line 3)</a>
|
||
|
|
||
|
:markdown
|
||
|
Implements json transforms to any object.
|
||
|
|
||
|
# Example
|
||
|
|
||
|
In this example we transform the user object to json.
|
||
|
|
||
|
```
|
||
|
@Component({
|
||
|
selector: "user-cmp"
|
||
|
})
|
||
|
@View({
|
||
|
template: "User: {{ user | json }}"
|
||
|
})
|
||
|
class Username {
|
||
|
user:Object
|
||
|
constructor() {
|
||
|
this.user = { name: "PatrickJS" };
|
||
|
}
|
||
|
}
|
||
|
|
||
|
```
|
||
|
|
||
|
|
||
|
.l-main-section
|
||
|
h2 Members
|
||
|
.l-sub-section
|
||
|
h3 transform
|
||
|
|
||
|
|
||
|
pre.prettyprint
|
||
|
code.
|
||
|
transform(value: any, args?: List<any>)
|
||
|
|
||
|
:markdown
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
.l-sub-section
|
||
|
h3 create
|
||
|
|
||
|
|
||
|
pre.prettyprint
|
||
|
code.
|
||
|
create(cdRef: ChangeDetectorRef)
|
||
|
|
||
|
:markdown
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|