Created
June 27, 2016 06:58
-
-
Save tkssharma/13a7219d4d8719a8692f81f719658976 to your computer and use it in GitHub Desktop.
This file contains hidden or 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'; | |
import {Http, Response} from '@angular/http'; | |
import {Observable} from 'rxjs/Rx'; | |
@Component({ | |
selector: 'demo-app', | |
template:` | |
<h1>Angular2 HTTP Demo App</h1> | |
<h2>Foods</h2> | |
<ul> | |
<li *ngFor="let food of foods">{{food.name}}</li> | |
</ul> | |
<h2>Books and Movies</h2> | |
<h3>Books</h3> | |
<ul> | |
<li *ngFor="let book of books">{{book.title}}</li> | |
</ul> | |
<h3>Movies</h3> | |
<ul> | |
<li *ngFor="let movie of movies">{{movie.title}}</li> | |
</ul> | |
` | |
}) | |
export class AppComponent { | |
public foods; | |
public books; | |
public movies; | |
constructor(private http: Http) { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment