UPDATED as requested with more info:
I have a controller that calls a web method and I want the returned JSON to be binded to a variable in the controller called applications. The alert displays the JSON correctly but I see nothing in my View.
Note I have tried $scope and 'this' in the controller with manual data and only 'this' worked which is why I have use it instead of $scope below.
app.controller('AppsController', function ($http, $scope) {
$http.post('/WebMethod/DoStuff', {}).
success(function (data, status, headers, config) {
alert(data);
this.applications = data;
})
}
My View is like this
<div class="container" ng-controller="AppsController as appCtrl">
<div class="row" ng-repeat="application in appCtrl.applications">
<div class="col-xs-6 applicationName" ng-click="appCtrl.expand($index)">{{application.name}}</div>
</div></div>
JSON like
[
{
name: "Application 1",
alerts: "2",
status: "Red",
notifications: [
{
header: "Notification Header 1",
updateType: "New",
message: "hello world",
startTime: "11:00",
endTime: "12:00"
}
],
expanded: false
}]