$index not working in Nativescript


#1

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.


#2

Did you try removing the $?


#3

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


#4

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?


#5

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…


#6

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