javascript - AngularJS - Passing nested variable with ng-click -
this answer helped me understand how bound variable via ng-click: how can pass bound variable ng-click function?
however, if variable needs passed nested variable?
for example:
the nested variable: {{item['id']['attributes']['im:id']}}
how called inside of ng-click?
<a ng-click="open('item['id']['attributes']['im:id']')">
definitely not work because of multliple use of single quote.
thanks!
__ edit ___
attached jsfiddle of trying achieve: http://jsfiddle.net/runae/4/
basically in $scope.test, value trying pass within ng-click
contoller {{ item['id']['attributes']['im:id']}}
for reference, believe correct solution question asked above: here jsfiddle future reference: http://jsfiddle.net/runae/6/
ng-click="open(item.id.attributes['im:id'])"
the non-proper variable placed within enclosing brackets.
hope future searchers.
Comments
Post a Comment