onclick not working on Android Emulator (ionic framework) -


steps: 1. ionic start hello blank

  1. add button index.html
 <ion-content>         <button class="button" onclick="javascript:alert('x');">try click</button> </ion-content> 
  1. inside hello dir: ionic run android
  2. 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

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -