Data binding access Array item via binded index does not work as mentioned in the docs
See original GitHub issuehttps://docs.nativescript.org/core-concepts/data-binding#supported-expressions
Referring to array access
Demonstration: https://play.nativescript.org/?template=play-js&id=YFnWeE
For some reason, this is not working as mentioned in the docs.
It works fine if I uses list[0]
(if I pass actual number when I bind it)
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Bind template item to the index of the array in KnockoutJS
Is there a way to bind to the index of the item in the array using KnockoutJS? It would be a shame if...
Read more >Data binding - Polymer Project
A data binding connects data from a custom element (the host element) to a property or attribute of an element in its local...
Read more >The "foreach" binding - Knockout.js
The foreach binding duplicates a section of markup for each entry in an array, and binds each copy of that markup to the...
Read more >Layouts and binding expressions | Android Developers
The Data Binding Library automatically generates the classes required to bind the views in the layout with your data objects. Data binding ......
Read more >Binding data and configuration options - IBM
The binding object, if defined, provides access to data that is bound to a ... function is not called, because the view is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@NickIliev Thanks to @PeterStaev, now I know to bind to variable index, of an array, Demo: https://play.nativescript.org/?template=play-js&id=YFnWeE&v=4
We can use
{{ list index, list[index] }}
to bind it. i.e., specify the variables and then use it.This part of the docs talks about it, https://docs.nativescript.org/core-concepts/data-binding#using-expressions-for-bindings
Closing this issue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.