onclick not working on Android Emulator (ionic framework) -
steps: 1. ionic start hello blank
- add button index.html
<ion-content> <button class="button" onclick="javascript:alert('x');">try click</button> </ion-content>
- inside hello dir: ionic run android
- click 'try click' button. nothing happens.
info: emulator: android 4.4.2 api 19
change ng-click , in general better call function.
you should separate logic views.
example html
<div ng-controller="logincontroller"> <ons-button ng-click="yourfunction()">click me!</ons-button> </div>
js
.controller('somecontroller', function () { $scope.yourfunction = function () { console.log("x triggered"); alert('x'); } }
Comments
Post a Comment