Skip to content

Instantly share code, notes, and snippets.

@Qarun-Qadir-Bissoondial
Created March 30, 2020 17:59
Show Gist options
  • Save Qarun-Qadir-Bissoondial/a77f2c952b395dfc24662aa21c061ff7 to your computer and use it in GitHub Desktop.
Save Qarun-Qadir-Bissoondial/a77f2c952b395dfc24662aa21c061ff7 to your computer and use it in GitHub Desktop.
Pipes Demo - Json Pipe
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