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
Post a Comment