JsonPipe

export class JsonPipe

exported from angular2/common defined in angular2/src/common/pipes/json_pipe.ts (line 2)

Transforms any input value using JSON.stringify. Useful for debugging.

Example

@Component({ selector: 'json-example', template: `<div> <p>Without JSON pipe:</p> <pre>{{object}}</pre> <p>With JSON pipe:</p> <pre>{{object | json}}</pre> </div>` }) export class JsonPipeExample { object: Object = {foo: 'bar', baz: 'qux', nested: {xyz: 3, numbers: [1, 2, 3, 4, 5]}} }

Annotations

@Pipe({name: 'json', pure: false})

@Injectable()


Members

transform(value: any, args?: any[]) : string

Not Yet Documented