$index not working in Nativescript


I’ve been searching for solutions with no luck, I’m trying to use the index of the observablearray but the console always throws and error and the rendered view doesn’t display anything but blank on the label the {{ $index }} is written.


Did you try removing the $?


yes… this is what is appearing in the console: Binding: Property: 'index' is invalid or does not exist. SourceProperty: 'index'


Pretty hard to say without seeing the js file. Do you have the observable variable setup in the JS file and then assigning it to the page.bindingContext?


Yes… but I was answered in another forum I posted the problem… he said Repeater doesn’t have $index built into them so I need to manually assign indexes on arrays… sad…


There are certain implications when you add an extra property into views, and that’s explained in the feature request issue on Github.