$IonicModal - modal.hidden event from $rootScope broadcasted #78
Description
From @jamy23 on October 23, 2016 3:3
ionic-team/ionic-framework@50348a9
In that commit was added modal.hidden/modal.shown/modal.removed events which brodcasted from parent scope of modal.
In case when we omitting "scope" property of IonicModal.initialize(options) then according to the docs parent scope will be $rootScope. That fact issued to call all event handlers of app on any action with some of modal.
In my case attaching my modals to the some deep scope is wrong, because my modals created at startup of app and living forever and has large large/main part of app which wouldn't be recreated. So I keep my modals as a services and omitting scope argument of .initialize is ok for me.
I propose to check that this.scope.$parent is equal to $rootScope then instead of broadcasting from $parent must be emit event from self scope
Copied from original issue: ionic-team/ionic-framework#8867