I am working with two different views. In the first view, I call a function from the admin controller using AngularJS:
<a ng-click="updateAdmin(admin)">update</a>
The code in the admin controller looks like this:
$scope.updateAdmin = function(admin){
console.log(admin);//output: result
$scope.updateAdminValues = admin;
$location.url ('/updateadmin');
console.log(updateAdminValues);//output: result
}
In the second view, I display the ID of the updated admin:{{ updateAdminValues._id }}
Both views are connected to the same controller.