I am passing a model object to MVC view which uses angularjs controller. In the script, I am accessing the model object and saving the model values to a variable. When the view is loaded, it does not run the script. how can I load the AppSettings variable?
Thank you!
<script>
var AppSettings = (function (o) {
return o;
})(@Html.Raw(JsonConvert.SerializeObject(@Model.AppSettings)));
alert("app settings = " + AppSettings);
</script>
<form name="payment" ng-submit="send()" ng-controller="PaymentCtrl">
</form>