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
Post a Comment