How to get value from a nested JSON array in AngularJS template?

痞子三分冷 提交于 2019-12-05 21:33:53

To access a property that contains a dash you need to use the bracket notation:

<p>Spotify id: {{track['external-ids'][0].id}} </p>

Otherwise the parser will interpret is as the subtraction operator:

track.external - ids[0].id

Demo: http://plnkr.co/edit/gIyXg8y0Pn1TuK0uI6qD?p=preview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!