Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: declarative ion-modal (angular) #20117

Closed
evgeniyefimov opened this issue Dec 23, 2019 · 3 comments
Closed

feat: declarative ion-modal (angular) #20117

evgeniyefimov opened this issue Dec 23, 2019 · 3 comments
Labels
package: angular @ionic/angular package type: feature request a new feature, enhancement, or improvement
Milestone

Comments

@evgeniyefimov
Copy link

Feature Request

Ionic version:

[x] 4.x

Describe the Feature Request

Make an option to open a modal window in template. It will allow devs to work with modals in a reactive way, Ionic for React is already working like this. Right now modal can be opened only programmatically with modal controller, it makes inconvenient to controlling modal state in reactive angular applications and reacting on data changes with OnPush. Also there is no way to pass template to the modal controller, only component's class.

Describe Preferred Solution

Would be great if we will be able to do things like this:

<ion-content>
      <ion-modal [isOpen]=showModal>
        <p>This is modal content</p>
        <ion-button (click)=setShowModal(false)>Close Modal</ion-button>
      </ion-modal>
      <ion-button (click)=setShowModal(true)>Show Modal</ion-button>
 </ion-content>
@ionitron-bot ionitron-bot bot added the triage label Dec 23, 2019
@liamdebeasi liamdebeasi added package: angular @ionic/angular package type: feature request a new feature, enhancement, or improvement labels Jan 2, 2020
@ionitron-bot ionitron-bot bot removed the triage label Jan 2, 2020
@mark-at-tusksoft
Copy link

mark-at-tusksoft commented Apr 14, 2021

Another case to make is similar to an issue we are currently experiencing.
Related SO article
Just to summarize, we want to pop a modal if the network goes down. If the network goes down and a modal hasn't been popped previously, the dependent scripts have not been loaded either.

While the current 'solution' works in non-production, the moment AOT tries to compile templates, the builder fails to resolve ion-modal. The alternative is presenting and dismissing a modal on app-start with ModalController which I have managed to get it to happen fast enough that it isn't rendered. Still messy, would like to just have it bootstrapped by declaring it in the root module.

@liamdebeasi liamdebeasi added this to the 6.0.0 milestone May 21, 2021
liamdebeasi added a commit that referenced this issue Jun 1, 2021
@liamdebeasi
Copy link
Contributor

Thanks for the issue. This has been resolved via #23341, and you will be able to use modals declaratively in Ionic Framework v6. We will have updated docs that show you how to do this.

@ionitron-bot
Copy link

ionitron-bot bot commented Jul 1, 2021

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jul 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: angular @ionic/angular package type: feature request a new feature, enhancement, or improvement
Projects
None yet
Development

No branches or pull requests

3 participants