Well ... spent a few hours searching and found a good solution, since I had the same problem, but could not find ...
I was as happy as Larry, and jumped off the chair when I finally figured out how to do it: D
This way you can access objects using dynamic keys ,
Sample Object:
var categories = { onion: { name: 'bar', id: 4 }, apple: { name: 'demo', id: 2 }, carrot: { name: 'foo', id: 3 }, Root: [ { name: 'apple' }, { name: 'onion' }, { name: 'carrot' } ] };
Instead of trying something like this: (that won't work)
{{
You can do:
{{
Hope this helps someone else too :)
Shq source share