I have a HTML page for listing users from MongoDB , this page delete and update users , i have a problem in the update button i want when i click on the button a new Html page appears with a form and get the id of the user from the previous view in another controller for the new controller.. i passed the id in ng-click(item._id) and i can show it in the console but in the new page the new controller can't read the id ( id is not defined )..
$scope.update = function (id) {
console.log(id);
$http.get('/readbyid/' + id).success(function (messages) {
$scope.item = messages;
});
}
in the new controller :
$http.get('/readbyid/' + id).success(function (messages) {
$scope.Candidator = messages;
console.log(id);
});