This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
bookmarks-delete-dialog.component.ts 923 B
Newer Older
import { Component } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { EventManager } from 'app/core/util/event-manager.service';

import { IUserWatchList } from 'app/shared/model/user-watch-list.model';
import { UserWatchListService } from 'app/entities/user-watch-list/user-watch-list.service';

@Component({
Michael Breu's avatar
Michael Breu committed
  templateUrl: './bookmarks-delete-dialog.component.html',
Michael Breu's avatar
Michael Breu committed
export class BookmarksDeleteDialogComponent {
  userWatchList?: IUserWatchList;

  constructor(
    protected userWatchListService: UserWatchListService,
    public activeModal: NgbActiveModal,
    protected eventManager: EventManager
  ) {}

  cancel(): void {
    this.activeModal.dismiss();
  }

  confirmDelete(id: number): void {
    this.userWatchListService.delete(id).subscribe(() => {
      this.eventManager.broadcast('userWatchListListModification');
      this.activeModal.close();
    });
  }
}