I want to read an array from the controller and use it in an Html script

25 Views Asked by At

I'd love some help here :) I'm trying to read the array I have in the controller into a variable in the script and use it.. Can someone help me please?

I'm actually trying to make an array of the names of the recipes that I already have in another list This is what I have on the controller

Then I need this list to use it in HTML and therefore - This is what I have in the script

As you understand, it doesn't work for me (by the way, when I enter directly in the script like this: var NAME=["---","---"...] it does work..)

I'm new to the subject, so I'm getting very confused.

Thanks in advance

0

There are 0 best solutions below