I am newbie in Angular and sending ViewBag data from ActionResult into the View. where in the view i want to access the ViewBag and put the content in the $scope object like
$scope.productList = ViewBag.productList;
but not having any idea about how to do this. Please suggest any reference.
Update:
I tried to get the ViewBag object in Window scope and then window scope to $scope object. but it does not work out.
<script>
window.Category = [];
@foreach (var listItem in (IEnumerable<SelectListItem>)ViewBag.Categories)
{
window.Category.Add(listItem.Text);
}
</script>