I've just started out using Ionic, I am trying to print the value of the selected list Item
{{ item.value }}
ng-click="myFunction()"
Well, at first ng-click="do"
will do absolutely nothing. It should be ng-click="do()"
, and of course, you have to have a function
called do
in your controller
to perform an action
.
The 2nd. problem is: you're inside ngRepeat
, it creates a child $scope
, so you have to use the Dot Rule
:
$scope.model = {};
Then, you can do it:
ng-click="model.itemValue = item"
Check the forked DEMO