Created
March 30, 2020 17:59
-
-
Save Qarun-Qadir-Bissoondial/a77f2c952b395dfc24662aa21c061ff7 to your computer and use it in GitHub Desktop.
Pipes Demo - Json Pipe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'app-json-pipe', | |
template: ` | |
<p>Object: {{data}}</p> | |
<p>Object with JsonPipe: {{data | json}}</p> | |
<p>array: {{array}}</p> | |
<p>array: {{array | json}}</p> | |
`, | |
styleUrls: [] | |
}) | |
export class JsonPipeComponent { | |
data: object = { | |
name: 'Qarun', age: 25, food: 'Cheesecake', | |
languages: [ | |
{ name: 'JavaScript', proficiency: 'Wizard' }, | |
{ name: 'Python', proficiency: 'Avergae' }, | |
{ name: 'Elixir', proficiency: 'Beginner'} | |
] | |
}; | |
array: number[] = [1,2,3,4,5,6]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment