Open vinothmoorthkumar opened 8 years ago
I can't help you with that little information sir.
Hi Foxandxss,
behalf of @vinothmoorthkumar i'm asking this
actually we include "toastr" in angular controller
angular.module('shopshy.productDetail', []) .controller('productDetailCtrl', productDetailCtrl); productDetailCtrl.$inject = ['toastr'];
function productDetailCtrl(toastr) { toastr.success('success'); }
if we use toastr.success it is giving error : "Target for toasts doesn't exist"
Are you overriding the toastr options?
yes
i'm over writing toastr with this config file. if i'm removing this its working fine but i need toastr in specific div that's why i wrote config file. code: .config(function(toastrConfig) { angular.extend(toastrConfig, { autoDismiss: true, maxOpened: 1, tapToDismiss: false, closeButton: true, closeHtml: '', target: 'notify', containerId: 'notify', onShown: function() { $("body").animate({scrollTop: $('#notification').offset().top}, "slow"); } }); })
You are doing it wrong and is probably my fault. Is not really clear from my readme.
Basically the toasts goes to a new container that is created as soon as you put your first toast (and disappear when there is none). That container is going to be created yes or yes with the id containerId
.
Then that container will be put on the body or if you want to put it in a different place, you give the id of that different target with target
.
In this case, you are adding a new container named notify
in a target called.... notify
. That won't work. Notify doesn't exist in your dom so it fails.
Target for toasts doesn't exist. Why This error is coming...