mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Issue number: resolves #27205 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> If an Angular component that makes use of `ModalController` or `PopoverController` has a property of its own named `modal` or `popover` respectively, this will collide with an internal reference to the modal/popover element and cause errors. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> The actual behavior is unchanged, but a console error is logged guiding the developer on how to fix the issue. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> I used the original reproduction from the issue to test. Full steps: 1. Clone the repo: https://github.com/Asac2142/expenses 2. Run `git checkout ef95c2e80a9991fe958d628f17ecc4e862c834ef` to get to the app's state from when the issue was originally posted. Observe that the component in `src/app/home/create-transaction` has a private prop named `modal`. 3. Run `npm install`, then install the dev build: `npm install @ionic/angular@7.0.7-dev.11684263140.15c242cf` 4. Run `ionic serve`. Click the fab button in the lower right. Observe the console error. If you scroll down in the modal and click the Category button, this will trigger the originally-reported issue. 5. Rename the private `modal` variable to something else, like `_modal`. 6. Refresh the page and re-open the modal. Note that no error is logged, and the Category button can be clicked to open another modal without issue.
@ionic/angular
Ionic Angular specific building blocks on top of @ionic/core components.
Related
- Ionic Core Components
- Ionic Documentation
- Ionic Forum
- Ionicons
- Stencil
- Stencil Worldwide Slack
- Capacitor
License
Testing ng-add in ionic
- Pull the latest from
main - Build ionic/angular:
npm run build - Run
npm linkfromionic/angular/distdirectory - Create a blank angular project
ng new add-test
// Say yes to including the router, we need it
cd add-test
- To run schematics locally, we need the schematics-cli (once published, this will not be needed)
npm install @angular-devkit/schematics-cli
- Link
@ionic/angular
npm link @ionic/angular
- Run the local copy of the ng-add schematic
$ npx schematics @ionic/angular:ng-add
You'll now be able to add ionic components to a vanilla Angular app setup.