$(document).ready(function () {
var imgs = @Model.EditProductImageList.ToArray();
console.log(imgs);
});
1 Answer
With the following you can serialize your object into a json and this can be parsed into an array with javascript
So your in your page/view would look like this:
<script type="text/javascript">
var json = '@Json.Serialize(Model.EditProductImageList)';
var array = JSON.parse(json);
</script>