javascript - How do I stop a modal instance from being called when a different controller loads with UI-bootstrap in Angular? -


i have implemented way controller open ui-bootstrap modal after specific time. if navigate away page still open. idea modal open after few minutes on specific view. how stop when different controller loads? in advance. please let me know if other code required.

here code open modal:

$interval(function () {         var modalinstance = $uibmodal.open({             animation: $scope.animationsenabled,             templateurl: 'modal.html',             controller: 'modalinstancectrl',             size: 'lg',         });                              }, 120000, [1]); 

you might need stop interval using $interval.cancel(your_interval) on route or state change please see answer "how track route or state change?" , go through $interval documentation $interval.cancel(). hope solve problem.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -