angular-toastr
angular-toastr copied to clipboard
TypeError: toastCtrl.startProgressBar is not a function
hi,
angular.js:12221 TypeError: toastCtrl.startProgressBar is not a function at createTimeout (angular-toastr.tpls.js:475) at Scope.scope.init (angular-toastr.tpls.js:436) at angular-toastr.tpls.js:173 at processQueue (angular.js:14454) at angular.js:14470 at Scope.$eval (angular.js:15719) at Scope.$digest (angular.js:15530) at angular.js:15758 at completeOutstandingRequest (angular.js:5370) at angular.js:5642
Getting this error when the first toast is called, after we have to click the toast to disable it tried diferent versions of angular and script sources
angular.module('MyApp', ['ngAnimate', 'toastr'])
.factory('ToastFactory', function (toastr) {
return {
error: function (sMessage) { toastr.error(sMessage, "Error"); },
info: function (sMessage) { toastr.info(sMessage, "Info"); },
success: function (sMessage) { toastr.success(sMessage, "Success"); },
warning: function (sMessage) { toastr.warning(sMessage, "Warning"); }
};
})
.controller('ToastController', function($scope, ToastFactory) {
$scope.toastSuccess = function(sMessage) {
ToastFactory.success(sMessage);
};
$scope.toastInfo = function(sMessage) {
ToastFactory.info(sMessage);
};
$scope.toastError = function(sMessage) {
ToastFactory.error(sMessage);
};
$scope.toastWarning = function(sMessage) {
ToastFactory.warning(sMessage);
};
});
`
I'm new with angular and is likely to doing something wrong , but I can not see thanks and sorry if not is real issue
That is weird. You aren't overriding any option on toastr?
That is really weeird. I will check when I have a minute.
ty
You are overriding the controller of the toast directive. Rename your controller and it will work.