为 Angular Toastr 的单个实例设置选项?
Set options for single instance of an Angular Toastr?
我正在使用 Angular JS 1.4.1 和 Angular Toastr 1.7.0。
我的应用程序中的大多数 toastr 都是默认的右上角,并且工作正常。
但是,我想用 positionClass: 'toast-top-full-width'
调用 ONE,但我无法让它工作。它仍然以默认设置打开我的应用程序配置。
$scope.tabLeave = function () {
toastr.warning('Warning', 'You have unsaved data.', {
closeButton: true,
positionClass: 'toast-top-full-width'
});
};
这里缺少什么?
基于documentation,似乎属性不能在toast中覆盖,但会在以后的版本中更改:
FAQ
Q: Why can't I override the positionClass in a toast? It gets ignored.
A: The toasts don't have a position, they are attached to a container
and is that container who has the position set on the page. This will
be changed in a future version.
this.toastr.info('No credit remaining', '', { disableTimeOut: true, closeButton: true });
我正在使用 Angular JS 1.4.1 和 Angular Toastr 1.7.0。
我的应用程序中的大多数 toastr 都是默认的右上角,并且工作正常。
但是,我想用 positionClass: 'toast-top-full-width'
调用 ONE,但我无法让它工作。它仍然以默认设置打开我的应用程序配置。
$scope.tabLeave = function () {
toastr.warning('Warning', 'You have unsaved data.', {
closeButton: true,
positionClass: 'toast-top-full-width'
});
};
这里缺少什么?
基于documentation,似乎属性不能在toast中覆盖,但会在以后的版本中更改:
FAQ
Q: Why can't I override the positionClass in a toast? It gets ignored. A: The toasts don't have a position, they are attached to a container and is that container who has the position set on the page. This will be changed in a future version.
this.toastr.info('No credit remaining', '', { disableTimeOut: true, closeButton: true });