mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-24 02:30:13 +00:00
Make the edit form and delete dialog work again
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user