So i'm fairly new to angular and what i'm trying to do is take a json collection that is obtained from a RESTful call and loop through each one to display their value while associating its designated id in a href.
below you will find what I have tried:
<div class="span2">
<!--Sidebar content-->
Search: <input ng-model="query">
Sort by:
<select ng-model="orderProp">
<option value="name">Alphabetical</option>
<!--option value="age">Newest</option>
<option value="-age">Oldest</option-->
</select>
</div>
<div class="span10">
<!--Body content-->
<ul class="documents">
<li ng-repeat="document in documents | orderBy:orderProp" class="thumbnail">
<a href="#/rest/{{document.document_id}}">{{document.title}}</a>
</li>
</ul>
<pre>{{ documents | json }}</pre>
</div>
the Shttp call:
function DocListCtrl($scope, $http)
{
console.log('getting documents data');
$http.get('/*RESTful call here*/').success(function(data)
{
$scope.documents = data;
});
$scope.orderProp = 'name';
}
when I run the page i get my list no problem using the
<pre>{{ documents | json }}</pre>
but the ng-repeat fails to implement.
EDIT
here is an example of the Json I am working with.
{
"next": {},
"items": [
{
"document_id": 3177554002,
"title": "title of some item"
}
]
}
What exactly am I doing incorrectly with the ng-repeat call that fails to list my data the way i wish?
Thanks for the help