angular-toastr icon indicating copy to clipboard operation
angular-toastr copied to clipboard

TypeError: toastCtrl.startProgressBar is not a function

Open ciferrerfa opened this issue 9 years ago • 5 comments

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

ciferrerfa avatar Aug 09 '16 14:08 ciferrerfa

That is weird. You aren't overriding any option on toastr?

Foxandxss avatar Aug 09 '16 14:08 Foxandxss

no, here my complete code client.zip

i need a web server? i don't have now.

ciferrerfa avatar Aug 09 '16 15:08 ciferrerfa

That is really weeird. I will check when I have a minute.

Foxandxss avatar Aug 09 '16 15:08 Foxandxss

ty

ciferrerfa avatar Aug 09 '16 15:08 ciferrerfa

You are overriding the controller of the toast directive. Rename your controller and it will work.

eziyoo avatar Oct 20 '16 09:10 eziyoo