I have a controller, in which I start an http request and once the request is completed, I call another view and then used ng-click
.But My ng-click
is not working .
here is 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>