Skip to content

Instantly share code, notes, and snippets.

@debugmodedotnet
Created March 23, 2018 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debugmodedotnet/e97a09a3109e623904b1d082377097a2 to your computer and use it in GitHub Desktop.
Save debugmodedotnet/e97a09a3109e623904b1d082377097a2 to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<ul *ngFor='let n of names'>
<li>{{n.name}}</li>
</ul>
`
})
export class AppComponent {
names = [];
constructor() {
this.names = this.getNames();
}
getNames() {
return [
{ 'name': 'dhananjay Kumar' },
{ 'name': 'jason beres' },
{ 'name': 'adam jafe' }
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment