So I have been able to confirm that data is getting into my angular function, but have been banging my head against the wall trying to get it to the DOM. I am doing everything as simple as I can before I start creating my full crud.
I'm sure I am missing something simple, as I am a newb with Angular and most certainly utilizing $http through asp.net api.
(function () {
angular
.module('appmodule')
.controller('campaignservice', ['$scope', '$http', campaignservice])
function campaignservice($scope, $http) {
$http.get("http://localhost:58291/api/campaigns").then(function (data) {
$scope.campaigns = data;
});
};
})();
and then the html
<div>
<div ng-controller="campaignservice">
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Pages </th>
</tr>
</thead>
<tbody>
<tr ng-repeat="campaign in campaigns">
<td>{{campaign.Id}}</td>
<td>{{campaign.Name}}</td>
<td>{{campaign.Pages}}</td>
</tr>
</tbody>
</table>
</div>
Whats my deal?? My brain is bleeding.