Make the edit form and delete dialog work again

This commit is contained in:
SteveSandersonMS
2016-01-26 11:17:01 +00:00
parent 381b7b884e
commit ea4c668a63
4 changed files with 25 additions and 31 deletions

View File

@@ -10,17 +10,15 @@ import * as models from '../../../models/models';
directives: [NgIf]
})
export class AlbumDeletePrompt {
private modalElement: any;
public album: models.Album;
constructor(@ng.Inject(ng.ElementRef) elementRef: ng.ElementRef) {
if (typeof window !== 'undefined') {
this.modalElement = (<any>window).jQuery(".modal", elementRef.nativeElement);
}
constructor(@ng.Inject(ng.ElementRef) private _elementRef: ng.ElementRef) {
}
public show(album: models.Album) {
this.album = album;
this.modalElement.modal();
// Consider rewriting this using Angular 2's "Renderer" API so as to avoid direct DOM access
(<any>window).jQuery(".modal", this._elementRef.nativeElement).modal();
}
}