2016-06-23 12:47:54 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2016-08-16 14:15:01 -04:00
|
|
|
import {Component, NgModule} from '@angular/core';
|
|
|
|
import {BrowserModule} from '@angular/platform-browser';
|
|
|
|
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
2015-11-02 18:46:59 -05:00
|
|
|
|
|
|
|
// #docregion JsonPipe
|
|
|
|
@Component({
|
2016-09-09 00:41:09 -04:00
|
|
|
selector: 'json-pipe',
|
2015-11-02 18:46:59 -05:00
|
|
|
template: `<div>
|
|
|
|
<p>Without JSON pipe:</p>
|
|
|
|
<pre>{{object}}</pre>
|
|
|
|
<p>With JSON pipe:</p>
|
|
|
|
<pre>{{object | json}}</pre>
|
|
|
|
</div>`
|
|
|
|
})
|
2016-09-09 00:41:09 -04:00
|
|
|
export class JsonPipeComponent {
|
2016-05-26 16:33:53 -04:00
|
|
|
object: Object = {foo: 'bar', baz: 'qux', nested: {xyz: 3, numbers: [1, 2, 3, 4, 5]}};
|
2015-11-02 18:46:59 -05:00
|
|
|
}
|
|
|
|
// #enddocregion
|