简体   繁体   中英

Using AngularJS Scope Variable in another scope Variable

I have a Problem with the AngularJS Scope. I want to use a Variable of it, which contains an Object. In the Object I want one index which is saved in another scope Variable. So I want something like that:

{{graphdata.nodes._data.{{selectedElements.nodes[0]}} }}

graphdata.nodes._data is the Object, and the index I want is saved in selectedElements.nodes[0] . Can someone help me with that?

You cannot and shouldn't interpolate twice. just write:

{{graphdata.nodes._data[selectedElements.nodes[0]]}}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM