I have built up an application that is running as expected on the desktop chrome browser.
However, when running on the latest Android/IOS devices, an ng-click never fires. If I add the standard onchange handler, it fires just fine. This is all running in the browser and not as an ‘application’.
You may want to NOT use the raw HTML to create this. Instead, consider using the Ionic built-in toggle directive. I get really strange issues when trying to use hand-coded checkboxes and radios with Ionic.
NOTE : I couldn’t attach an ng-click to the <toggle> directive. So, I watched the model to be aware of the change.
Here’s a sample plnkr.
Now, can somebody please explain to the lay person fundamentally why my first experiment gone bad didn’t work?
I also noticed that I couldn’t add my own ng-click as it is already declared in the directive. How do I add-in my own ng-click so I can do some cleanup around the toggle?
Hey @jfinnigan, like @Calendee said, the reason you want to use the Angular directives when we offer them is because if you just use the markup, there is no logic to wire up events, etc. Think of the <toggle> directive as a self-contained component that may or may not have child DOM you don’t need to worry about, it just works.
Thanks @max. It’s just that it was working as expected on the desktop chrome. I figured the ng-click is generic and angular is ‘wiring’ it all up under the hood. Bad assumption.