Angularjs deferred log-running timer task(s)

well in case when you are doing tasks using $timeout , you have got to stop and destroy them else they would create the error you stated

for eg:

var timer = $timeout(
                        function() {
                            console.log( "Timeout executed", Date.now() );
                        },
                        2000
                    );

if you start a timeout as above then you got to destroy the timer as follows :

                    // When the DOM element is removed from the page,
                    // AngularJS will trigger the $destroy event on
                    // the scope. This gives us a chance to cancel any
                    // pending timer that we may have.
$scope.$on(
                        "$destroy",
                        function( event ) {
                            $timeout.cancel( timer );
                        }
                    );

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)