ryzskzkhie ryzskzkhie - 1 year ago 46
AngularJS Question

AngularJs : Referencing to the value of an object inside angular {{ }} html markup

I have an object like this:

items = [{a:1,b:2},{a:3,b:4}];
lists = [a,b];


Then this is my markup:

<div ng-repeat="item in items">
<div ng-repeat="list in lists">
// I want to display like this
{{ item.{{list}} }}
</div>
</div>

Answer Source

Access it in the following manner :

<div ng-repeat="item in items">
 <div ng-repeat="list in lists">
      {{item[list]}}
 </div>
</div>