main
Line | |
---|
1 | import { ToastrService } from "ngx-toastr";
|
---|
2 | import { ErrorHandlerModel } from "src/app/models";
|
---|
3 |
|
---|
4 | export function ShowErrorToaster(toastr: ToastrService, response: any){
|
---|
5 | let error: ErrorHandlerModel = response.error
|
---|
6 | if(error.name != undefined) toastr.error(error.description, error.name, {positionClass: 'toast-bottom-right'})
|
---|
7 | else toastr.error(response.error, "An error occured with the action.", {positionClass: 'toast-bottom-right'})
|
---|
8 | }
|
---|
9 |
|
---|
10 | export function ShowSuccessToaster(toastr: ToastrService){
|
---|
11 | toastr.success("Action was completed successfully.", "Success", {positionClass: 'toast-bottom-right'})
|
---|
12 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.