I have a list of names that is connected to different objects in an array. I would like to, whenever you click one of the names, get the values and output them in another list respective to that that object. For right now I console.log the right values, but don't know how to output it:
<a href="#" id="name" ng-click="updateIndex($index);">{{ person.name }}</a>
Controller:
$scope.updateIndex = function(index) {
console.log($scope.person[index]); //Logs the right values
}
How can I output the values from the object which name is clicked to:
<div class="wrap" ng-repeat="per in person">
<div class="box">
{{ person.name }}
</div>
<div class="box">
{{ person.age }}
</div>
<div class="box">
{{ person.town }}
</div>
<div class="box">
{{ person.country }}
</div>
<div class="box">
{{ person.gender }}
</div>
</div>
Thanks!
output the values from the object?