mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2026-02-09 17:44:14 +00:00
Initial state
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<h2>Album <small>Details</small></h2>
|
||||
<hr />
|
||||
|
||||
<form class="form-horizontal" role="form" *ng-if="albumData">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">Artist</label>
|
||||
<div class="col-md-10">
|
||||
<p class="form-control-static">{{ albumData.Artist.Name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">Genre</label>
|
||||
<div class="col-md-10">
|
||||
<p class="form-control-static">{{ albumData.Genre.Name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">Title</label>
|
||||
<div class="col-md-10">
|
||||
<p class="form-control-static">{{ albumData.Title }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">Price</label>
|
||||
<div class="col-md-10">
|
||||
<p class="form-control-static">{{ albumData.Price | currency:'USD':true }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">Album Art URL</label>
|
||||
<div class="col-md-10">
|
||||
<p class="form-control-static">{{ albumData.AlbumArtUrl }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">Album Art</label>
|
||||
<div class="col-md-10">
|
||||
<img alt="{{ albumData.Title }}" src="{{ albumData.AlbumArtUrl }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<a class="btn btn-primary" [router-link]="['/Admin/AlbumEdit', { albumId: albumData.AlbumId }]">Edit</a>
|
||||
<button type="button" class="btn btn-danger" (click)="deleteprompt.show(albumData)">Delete</button>
|
||||
<a class="btn btn-default" [router-link]="['/Admin/Albums']">Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<album-delete-prompt #deleteprompt></album-delete-prompt>
|
||||
@@ -0,0 +1,22 @@
|
||||
import * as ng from 'angular2/angular2';
|
||||
import * as router from 'angular2/router';
|
||||
import * as models from '../../../models/models';
|
||||
import { Http, HTTP_BINDINGS } from 'angular2/http';
|
||||
import { AlbumDeletePrompt } from '../album-delete-prompt/album-delete-prompt';
|
||||
|
||||
@ng.Component({
|
||||
selector: 'album-details'
|
||||
})
|
||||
@ng.View({
|
||||
templateUrl: './ng-app/components/admin/album-details/album-details.html',
|
||||
directives: [router.ROUTER_DIRECTIVES, ng.NgIf, AlbumDeletePrompt]
|
||||
})
|
||||
export class AlbumDetails {
|
||||
public albumData: models.Album;
|
||||
|
||||
constructor(http: Http, routeParam: router.RouteParams) {
|
||||
http.get('/api/albums/' + routeParam.params['albumId']).subscribe(result => {
|
||||
this.albumData = result.json();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user