angularjs - Angular - Displaying an object using a dynamic variable? -
i have following code:
{{ currentproductdetails.metadata.spec_category_0_spec_image }} but need 0 reference variable. this:
{{ currentproductdetails.metadata.spec_category_{{ configview }}_spec_image }} but doesn't work. there way can accomplish this?
thanks.
you need use bracket notation here:
{{ currentproductdetails.metadata['spec_category_' + configview + '_spec_image'] }} think of currentproductdetails.metadata object, , 'spec_category_' + configview + '_spec_image' construct dynamic property key of it.
Comments
Post a Comment