Ng-model with Button

Asked

Viewed 94 times

0

Good morning, I loop to pick up "name" in an array and each "name" has variables with information. I need the ng-model to receive the "name" value when I click on the "button" so that I can make a loop inside this "name".

<div class="list-group" ng-repeat="rep in list.report">
  <button type="button" class="list-group-item " ng-model="ctrl.x=" style="width:450px;height:35px" ng-click="showDetails = ! showDetails">
       {{rep.name}}
  </button></div>
  • It’s a bit confusing for me... You will give a repeat, will generate several buttons with each rep and his name as a description of the button. By clicking the button you want to take the values you have inside the name? (name is an object/array too?)

  • That’s exactly what you explained.

No answers

Browser other questions tagged

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