You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the qr-scanner in a ng-view. When switching back with the arrows keys the view gets destroyed and so the qr-scanner stops scanning as expected. (because your module listens for $destroy if I understand the code correctly).
However, in my particular case I am switching the states/views with state.go().
After the view switched, the qr-scanners interval is still running. How can I stop it from doing so?
I could implement a listener into your code, to listen for a certain event to then clear the interval. But i am not sure, it's the cleanest way to go for.
thanks!
(I am an angular newbie, so excuse me if the answer to the problem is rather simple)
The text was updated successfully, but these errors were encountered:
Hi,
You can also broadcast a $destroy event before switching state.
I also needed to stop the scanner with a button click and what I have done i this :
function stopScan() {
$scope.$broadcast('$destroy');
}
Not sure this is the cleanest way to do but I does the job.
I am using the qr-scanner in a ng-view. When switching back with the arrows keys the view gets destroyed and so the qr-scanner stops scanning as expected. (because your module listens for
$destroy
if I understand the code correctly).However, in my particular case I am switching the states/views with
state.go()
.After the view switched, the qr-scanners interval is still running. How can I stop it from doing so?
I could implement a listener into your code, to listen for a certain event to then clear the interval. But i am not sure, it's the cleanest way to go for.
thanks!
(I am an angular newbie, so excuse me if the answer to the problem is rather simple)
The text was updated successfully, but these errors were encountered: