2015-07-27 22:12:30 -07:00
p.location-badge.
exported from <a href='../pipes'>angular2/pipes</a>
2015-08-11 17:09:57 -07:00
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.34/modules/angular2/src/pipes/json_pipe.ts#L6-L36">angular2/src/pipes/json_pipe.ts (line 6)</a>
2015-07-27 22:12:30 -07:00
: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" };
}
}
```
2015-07-28 13:28:47 -07:00
.l-main-section
h2 Annotations
.l-sub-section
h3.annotation CONST
pre.prettyprint
code.
@CONST()
2015-07-27 22:12:30 -07:00
.l-sub-section
2015-08-11 17:09:57 -07:00
h3.annotation Pipe
2015-07-27 22:12:30 -07:00
pre.prettyprint
code.
2015-08-11 17:09:57 -07:00
@Pipe({name: 'json'})
2015-07-27 22:12:30 -07:00
2015-08-11 17:09:57 -07:00
.l-sub-section
h3.annotation Injectable
pre.prettyprint
code.
@Injectable()
2015-07-27 22:12:30 -07:00
2015-08-11 17:09:57 -07:00
.l-main-section
h2 Members
2015-07-27 22:12:30 -07:00
.l-sub-section
2015-08-11 17:09:57 -07:00
h3 transform
2015-07-27 22:12:30 -07:00
pre.prettyprint
code.
2015-08-11 17:09:57 -07:00
transform(value: any, args?: List<any>)
2015-07-27 22:12:30 -07:00
:markdown