I am trying to make a website using Fullcalendar scheduler plugin and want to be able to use the items from my Model to fill in the "Resources".
the resources-function looks like this:
resources: [
{ id: 'room01', title: 'Room 1' },
{ id: 'room02', title: 'Room 2' },
],
But I want to be able to do something like this:
resources: [
@foreach (var item in model)
{
{ id: item.id, title: item.firstname };
}
],
However its not working and I cant really understand why. I tried using parenthesis to make it look the same like this:
"{ id: '" + item.id + ", title: '"+ item.firstname + " }"
but its not working. I am very new to coding and never used advanced commands like this before. Please advice how I could solve this.