Ion-Tab: Click event fires multiple times
Short description of the problem:
When setting an [click] or [select] event on a tab the event fire's more than once.
What behavior are you expecting?
Click only fires once when clicking on it.
Steps to reproduce:
- Put the plunkr code into a new project
- run it
- open the console
- you'll see that when launching the app it'll say 17 times clicked and when clicking the tab it also shows multiple times "clicked".
insert any relevant code between the above and below backticks
``
Which Ionic Version? 2.x
Plunker that shows an example of your issue
http://plnkr.co/edit/eebNspnniClOq2IJLp8X?p=preview
Instructions: open the console to see multiple times "clicked".
Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: 6.1.1 Gulp version: CLI version 1.2.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.6 Ionic CLI Version: 2.0.0-beta.25 Ionic App Lib Version: 2.0.0-beta.15 OS: Node Version: v4.1.0
Other relevant info:
The idea behind putting an click event on the ion-tab is to show a pop-up where you can choose between multiple tabs
Hello! Thanks for opening an issue with us! Here is a plunker that shows the correct way to bind to an event in Angular 2/Ionic 2. () is used when binding to an event and [] is for binding to an attribute. Also, here is a link to the official angular 2 documentation on using () to bind to events. Thanks for using Ionic! And feel free to comment if you have any more questions!
Hi, with using the () the function doesn't work. I ran your plunker and there's nothing to see in the console.