javascript - nested/dynamic handlebars in angular -


maybe i'm thinking wrong way let me explain:

i have 16 products , multiple orders. know these 16 products ever have. (the following code doesn't work)

<div ng-repeat="order in orders">     <span ng-repeat="product in products">{{order.{{product}}}}</span>  </div> 

my orders structured this:

{"date":"5834755","product1":564,"product2":456,etc... 

i write this:

<div ng-repeat="order in orders">     <span>{{order.product1}}</span>     <span>{{order.product2}}</span>     etc... </div> 

i overthinking , trying on simplify template... think?

i have used similar notation print data of object , recommend following:

<div ng-repeat="order in orders">     <span ng-repeat="product in products">{{order[product]}}</span>  </div> 

this should work.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -