How to transfer data to another page using AngularJS?

Brand new for angularJS and trying to transfer information from one page to another.

Currently, this controller displays a list of clients in table format, with one column being "Additional Information".

 ** adminSearch.html **
 <div ng-controller="adminSearch">
 ...    
 <tr ng-repeat-start="custObj in customers | filter:custSearch">                         
    <td> {{custObj.id}} </td>
    <td> {{custObj.name}} </td>
    <td> <a href="#"> More Info </a></td>
 </tr> 
 ...

Controller:

** adminSearch.js **
app.controller('adminSearch', ['$scope', function($scope) {         
$scope.customers = [{id:1, name:'John', email:'John@example.com', phone:'555-1276', account:123456, mylH: '1'},
             {id:2, name:'Mary', email:'Mary@example.com', phone:'800-BIG-MARY', account:123456, mylH: '1'},
             {id:3, name:'Mike', email:'Mike@example.com', phone:'555-4321', account:123456, mylH: '0'}];}]);

What I want is when the user clicks "Additional Information" from the table for one of the clients, he must go to a new page that displays all the information about this client ...

Not sure what a new page needs, but I guess it needs a new controller:

  ** customerInfo.html **
  <div ng-controller="customerInfo"> ... </div>

  ** customerInfo.js **
  app.controller('customerInfo', ['$scope', function($scope) {
  }]);

Thanks for your help in advance!

+4
source share
1 answer

All Articles