简体   繁体   中英

How to pass data from html page to another using angular and nodejs


Here is mine controller:

app.controller('UserListCtrl', function($scope, UsersResource){
    $scope.users = UsersResource.query();
});

This is my page (written in Jade)

li(ng-repeat="user in users")
  a.button(href='/user/{{ user.id }}') View Profile

The problem is that I want to have for each user unique id without having to declare it in database (MongoDB) and when I click on that user , I want it to be passed on the next page (/user/uniqueId) and show information about the user (user.firstName and user.lastName)

Before some days I had the same problem, I read some where that angular is basically for Single Page Applications.

I used templates to overcome that problem.

This Page talks about how to use this.

I have given my github reference, the one which I solved.

cheers All the best

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM