How to pass json varaible in controller AngularJS -


i new angularjs. have doubts. have json data value in 1 variable. how use varaible in controller ? example

$scope.paresejson($scope.productresult); 

in productresult have values brand, size , color. if console console.log("prdmake" , prdmake); getting brand values.

how pass variable in controller ?

$scope.items = [                  {                     name: "item1",                     desc: "shop brand",                     subitems:                          {                             name: "subitem1",                             desc: "prdmake"                         }                  }]; 

i want use prdmake (json variable) in subitems desc:

you can use $scope.items.name value, in 1.4 should work $scope.items[name]


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -