Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

FAQ Angular - How do you customize the abp.notify dialogs #6908


User avatar
0
commondesk created

The apb.notify. object in Angular is based on toastr library

https://codeseven.github.io/toastr/demo.html

And can be customized by passing a third argument.

var defaultOptions = {
	position: 'top-end',
	showConfirmButton: false,
	timer: 10000,
	padding: 0,
	toast: true,
	animation: false
};
abp.notify.success("The User was succesfully removed.","",defaultOptions);

3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    You can modify the default options.

    https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/src/assets/abp-web-resources/abp.notify.js#L6

  • User Avatar
    0
    commondesk created

    But the problem is, after you use different options, those are merged with the current options, and used next time the dialog is called.

    And there is not way to undo this?

    Why would anyone want that feature?

  • User Avatar
    0
    maliming created
    Support Team

    hi @commondesk

    I believe the order of the parameters is wrong, I will fix it. Thanks for the feedback.

    https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/src/assets/abp-web-resources/abp.notify.js#L25

    should be: var combinedOptions = Object.assign({}, defaultOptions, options);