I'm trying to pass an array from my MVC Model into a javascript array (to use in fullCalendar), however having an issue.
From the below, "myArray" is being populated with the correct amount of items from the model array, but when I try to show obj.DateTime (valid field within the MVC model array) it returns undefined. The undefined alert appears the correct amount of times for items in the array.
Any help at all would be appreciated.
var myArray = [];
@foreach (var d in Model.Appointments)
{
@:myArray.push("@d");
}
myArray.forEach(function (obj) {
alert(obj.DateTime);
})