Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: toastCtrl.startProgressBar is not a function #194

Open
ciferrerfa opened this issue Aug 9, 2016 · 5 comments
Open

TypeError: toastCtrl.startProgressBar is not a function #194

ciferrerfa opened this issue Aug 9, 2016 · 5 comments

Comments

@ciferrerfa
Copy link

ciferrerfa commented Aug 9, 2016

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

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-animate.js"></script> <script type="text/javascript" src="https://npmcdn.com/angular-toastr/dist/angular-toastr.tpls.js"></script>

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);
    };

});

`


Success
Info
Error
Warning

`

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

@Foxandxss
Copy link
Owner

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

@ciferrerfa
Copy link
Author

no, here my complete code
client.zip

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

@Foxandxss
Copy link
Owner

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

@ciferrerfa
Copy link
Author

ty

@eziiyo
Copy link

eziiyo commented Oct 20, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants