I am looking to retrieve specific user subdocument data on a separate page by passing the id
parameter in a URL using ng-click
in AngularJS.
<tr ng-repeat="register in registerlist | filter:searchText">
<td>{{$index+1}}</td>
<td>{{register.name}}</td>
<td>{{register.email}}</td>
<td>{{register.mobile_no}}</td>
<td>{{register.area_name}}</td>
<td>
<button type="button" class="btn btn-default"
ng-click="RegisterView(register._id); showOrder = !showOrder">View</button>
</td>
</tr>
Example URL:
localhost:8080//register/5426ced88b49d2e402402205
In this case, the user mentioned above has a subdocument, which is why I need to access and view it on a separate page.
Controller:
$scope.RegisterView = function(id) {
$scope.IsVisible = $scope.IsVisible ? false : true;
$http.get('/auth/register-list/' + id).success(function(response){
$scope.bookinglist = response.booking;
});
};