I'm trying to access my asp.net MVC model from angularjs. I can convert the model to a javascript object using var model = @Html.Raw(Json.Encode(Model));
this works fine -I can access the object from the console in chrome.
Next I try to create a UL wit ng-repeat -this doesn't work. The UL does not appear on the page and there are no errors in the console. Can anyone tell me what I might be doing wrong?
<script type="text/javascript" src="/Scripts/angular.min.js"> </script>
<script type="text/javascript" src="/Scripts/app.js"> </script>
<h2>Heading</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal" ng-app="app" ng-controller="editUser">
<script type="text/javascript">
var model = @Html.Raw(Json.Encode(Model));
var Permissions = model.Permissions;
</script>
<h4>UserSetting</h4>
<hr/>
@Html.ValidationSummary(true, "", new {@class = "text-danger"})
@Html.HiddenFor(model => model.Id)
<ul>
<li ng-repeat="permission in Permissions">
<span>{{permission.Guid}}</span>
<p>{{permission.SatelliteAccount}}</p>
</li>
</ul>
And my app.js:
var app= angular.module('app', []);
app.controller('editUser', function ($scope) {
});