I am working on a web app, and I want to show data in a list, by category. I am getting back AJAX data that has a title, and a category. The code to get that is like this:
angular.module('getImageData', ['ngResource'])
.factory('images', function ($resource)
{
return $resource('/ImageData/GetImages', {}, {
query: { method: 'GET', isArray: true }
});
});
and then like this:
$scope.imageData = images.query(function (response)
{
// This has become superfluous
return response;
});
The AJAX call us occurring and I can see my data in Chrome.
Then here is my HTML:
<ul>
<li data-ng-repeat="image in imagedata">
<a href="">{{image.Title}}</a>
</li>
</ul>
I intend to do this:
<ul>
<li data-ng-repeat="image in imagedata | filter : {TypeFilter : 'a' }">
<a href="">{{image.Title}}</a>
</li>
</ul>
but for now I'm keeping it simple.
The list is never rendered. This is the HTML I see in chrome:
<ul>
<!-- ngRepeat: image in imagedata -->
</ul>
I am assuming this means it ran before the data came back. How do I make it wait ?
Thanks.