Skip to content
Advertisement

Invalind linking throws ‘id’ expected a number but got ‘{{ navbarList.0.category }}’

I have probably a very simple error but I can’t figure it out.

I have a category model that looks like this. Navbar field is for putting the category name and link to it in the navbar section on the page.

JavaScript

Due to menu layout looking like this I need to set nav links manually

JavaScript

So I’ve set them like this

JavaScript

And this throws error

JavaScript

Advertisement

Answer

You should not wrap variables included in tags with braces, remove them and reference the variable without any wrapper

JavaScript
Advertisement