Catch value of a li Angularjs Ionic

Asked

Viewed 108 times

0

<div class="list">
<li class="item" ng-click="city()" ng-repeat="seg in segmento">{{seg}}</li>
</div>

I have this code in my Ionic framework I would like to get the value of li I’ve tried with name, ng-model someone has any suggestions?

  • Pass your segment by parameter to the city function. Ex; city(sec)

  • Why don’t you take the data directly from the "segment" array? It’s easier.

  • I thought of going through the parameter, but is that dps I’ll have to pick up this value again.

  • You can’t take it by the segment array, because this list has a click I want the value that the user click on the case.

1 answer

1


<div class="list">
<li class="item" ng-click="city(seg)" ng-repeat="seg in segmento">{{seg}}</li>
</div>

The seg is the selected element, you can pass by parameter.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.