| 
									
										
										
										
											2016-06-23 09:47:54 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							| 
									
										
										
										
											2020-05-19 12:08:49 -07:00
										 |  |  |  * Copyright Google LLC All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2016-06-23 09:47:54 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  * 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-09-27 17:12:25 -07:00
										 |  |  | import {Component} from '@angular/core'; | 
					
						
							| 
									
										
										
										
											2015-11-02 15:46:59 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // #docregion JsonPipe
 | 
					
						
							|  |  |  | @Component({ | 
					
						
							| 
									
										
										
										
											2016-09-08 21:41:09 -07:00
										 |  |  |   selector: 'json-pipe', | 
					
						
							| 
									
										
										
										
											2015-11-02 15:46:59 -08:00
										 |  |  |   template: `<div>
 | 
					
						
							|  |  |  |     <p>Without JSON pipe:</p> | 
					
						
							|  |  |  |     <pre>{{object}}</pre> | 
					
						
							|  |  |  |     <p>With JSON pipe:</p> | 
					
						
							|  |  |  |     <pre>{{object | json}}</pre> | 
					
						
							|  |  |  |   </div>`
 | 
					
						
							|  |  |  | }) | 
					
						
							| 
									
										
										
										
											2016-09-08 21:41:09 -07:00
										 |  |  | export class JsonPipeComponent { | 
					
						
							| 
									
										
										
										
											2016-05-26 13:33:53 -07:00
										 |  |  |   object: Object = {foo: 'bar', baz: 'qux', nested: {xyz: 3, numbers: [1, 2, 3, 4, 5]}}; | 
					
						
							| 
									
										
										
										
											2015-11-02 15:46:59 -08:00
										 |  |  | } | 
					
						
							|  |  |  | // #enddocregion
 |