notifications.component.ts 1.07 KB
Newer Older
Ooh-Ao committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
import { Component, ViewChild } from '@angular/core';
import { ToastrService } from 'ngx-toastr';

@Component({
  selector: 'app-notifications',
  templateUrl: './notifications.component.html',
  styleUrls: ['./notifications.component.scss'],
})
export class NotificationsComponent {
  constructor(private toastr: ToastrService) {}

  showSuccess() {
    this.toastr.success('This is an example of tip', 'TIP', {
      timeOut: 3000,
      positionClass: 'toast-bottom-right',
    });
  }
  
  showError() {
    this.toastr.error('This is an example of tip', 'TIP', {
      timeOut: 2000,
      positionClass: 'toast-top-right',
    });
  }

  showInfo() {
    this.toastr.info('This is an example of tip', 'TIP', {
      timeOut: 1500,
      positionClass: 'toast-top-left',
    });
  }

  ShowWarning() {
    this.toastr.warning('This is an example of tip', 'TIP', {
      timeOut: 1500,
      positionClass: 'toast-top-left',
    });
  }

  Notification() {
    this.toastr.info('This is an example of tip', 'TIP', {
      timeOut: 1500,
      positionClass: 'toast-top-center',
    });
  }

}