Skip to content
This repository was archived by the owner on May 4, 2022. It is now read-only.
This repository was archived by the owner on May 4, 2022. It is now read-only.

$IonicModal - modal.hidden event from $rootScope broadcasted #78

Open
@jgw96

Description

@jgw96

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions