Currently, I have a controller that sends data to the UI and uses the ng-repeat directive to map them. My next goal is to bind this data with a hidden input form and then send it to another function in the controller when a click event occurs. Any tips on how to achieve this?
<div class="card card-block" ng-repeat="admin in showAdmins">
<h3 class="card-title">{{admin}}</h3>
<input type="hidden" ng-value="{{admin}}" ng-model="username"/>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<button class="btn btn-primary" ng-click="searchAdmins(username)">SeeProfile</button>
</div>
Here's an example of my HTML:
$scope.searchAdmins = function(username){
//To do
};
github.users('admins.php').then(function(users){
$scope.showAdmins = users;
console.log($scope.showAdmins);
});