mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-28 04:27:32 +00:00
Initial state
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<h3>Albums</h3>
|
||||
|
||||
<ul class="list-unstyled">
|
||||
<li *ng-for="#album of albums" class="col-lg-2 col-md-2 col-sm-2 col-xs-4 container">
|
||||
<album-tile [albumData]="album"></album-tile>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,22 @@
|
||||
import * as ng from 'angular2/angular2';
|
||||
import * as router from 'angular2/router';
|
||||
import { Http } from 'angular2/http';
|
||||
import * as models from '../../../models/models';
|
||||
import { AlbumTile } from '../album-tile/album-tile';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'genre-contents'
|
||||
})
|
||||
@ng.View({
|
||||
templateUrl: './ng-app/components/public/genre-contents/genre-contents.html',
|
||||
directives: [ng.NgFor, AlbumTile]
|
||||
})
|
||||
export class GenreContents {
|
||||
public albums: models.Album[];
|
||||
|
||||
constructor(http: Http, routeParam: router.RouteParams) {
|
||||
http.get(`/api/genres/${ routeParam.params['genreId'] }/albums`).subscribe(result => {
|
||||
this.albums = result.json();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user