Scopes Not Destroyed with menuClose directive #105
Description
From @calendee on August 19, 2016 21:5
Short description of the problem:
When using the sidemenu links to navigate from the current view, the current view's controller/view is not destroyed nor is its scope disconnected. It remains active and all watches are still active.
What behavior are you expecting?
When using the sidemenu links to navigate, the current view and controller should be destroyed. Since the menu-close
directive causes the app's history root to be reset, that process should disconnect the current view's scope.
When using $ionicHistory.nextViewOptions
with historyRoot
or disableBack
, the current view/scope should be clobbered on the next state change.
Steps to reproduce:
- Visit http://plnkr.co/edit/veYrgw7Y4m8jY4ScIFcO and open the console.
- Notice the console logs out "HomeCtrl Interval Triggered!" every 3 seconds
- Open the sidemenu
- Tap "Check-in"
- Notice the console continues to log that "HomeCtrl Interval Triggered!" every 3 seconds
- Notice the
$destroy
event is never fired for the HomeCtrl - no console logging occurs.
Which Ionic Version? 1.3
Plunker that shows an example of your issue
http://plnkr.co/edit/veYrgw7Y4m8jY4ScIFcO
Run ionic info
from terminal/cmd prompt: (paste output below)
Your system information:
Cordova CLI: 6.2.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.3.1
Ionic CLI Version: 2.0.0-beta.30
Ionic App Lib Version: 2.0.0-beta.16
ios-deploy version: 1.8.6
ios-sim version: 4.1.1
OS: Mac OS X El Capitan
Node Version: v4.4.7
Xcode version: Xcode 7.3.1 Build version 7D1014
Copied from original issue: ionic-team/ionic-framework#7788