I am facing an issue with my controller code. I have set up an http request and upon completion, I trigger another view using ng-click. However, for some reason, my ng-click functionality is not working as expected.
Below is the snippet of my code:
app.controller('listuser', function ($scope,$http,$log,$window) {
$scope.userdetail = {};
return $http({
method: 'POST',
url: 'apisource.php',
})
.then(function (results) {
$scope.data=results.data;
return $scope.data;
});
$scope.douserdetail = function(user) {
alert('test');
};
});
<tr data-ng-repeat="x in data">
<td>
<input type="hidden" name="id" ng-model="userdetail.id" value="{{x.id}}" />
<a href='' ng-click="douserdetail(userdetail)" class="user-link">{{x.First_Name}}{{x.Last_time}}</a>
<span class="user-subhead">{{x.Phd_University}}</span>
</td>
</tr>