javascript - Pass an object property through an URL -


i have list of objects defined this.

var users = [{id:1,name:"rudy",color:"orange"},{id:2,name:"sean",color:"blue"},{id:2,name:"rob",color:"green"}] 

i make table holding each object , properties. want able click on row , open new page properties in corresponding object.

i have html file called userinfo.html looks this:

    <tr ng-repeat="user in users">     {{user}}         <td  ng-click="window.location.href = '#/userinfo#' + user.id" >{{user.id}}<td>         <td  ng-click="window.location.href = '#/userinfo#' + user.id" >{{user.name}}<td>         <td  ng-click="window.location.href = '#/userinfo#' + user.id" >{{user.color}}<td> </tr> 

i trying pass user id through url. not let me no matter try. if replace user.id string or integer works fine.

is there reason won't pass object property. there better way accomplish this?

thank help!!

use

<td  ng-click="window.location.href = '#/userinfo#{{user.id}}'" >{{user.id}}<td> 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -