Alexis Hernandez
7 years ago
2 changed files with 27 additions and 1 deletions
@ -0,0 +1,22 @@ |
|||||
|
import { Injectable } from '@angular/core'; |
||||
|
|
||||
|
import { ToastrService } from 'ngx-toastr'; |
||||
|
|
||||
|
const toastrOptions = { |
||||
|
tapToDismiss: true, |
||||
|
positionClass: 'toast-top-center' |
||||
|
}; |
||||
|
|
||||
|
@Injectable() |
||||
|
export class NotificationService { |
||||
|
|
||||
|
constructor(private toastrService: ToastrService) { } |
||||
|
|
||||
|
info(message: string) { |
||||
|
this.toastrService.info(message, '', toastrOptions); |
||||
|
} |
||||
|
|
||||
|
error(message: string) { |
||||
|
this.toastrService.error(message, '', toastrOptions); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue