Note that there are some explanatory texts on larger screens.

plurals
  1. POng-repeat fails to execute correctly angularjs
    primarykey
    data
    text
    <p>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.</p> <p>below you will find what I have tried:</p> <pre><code>&lt;div class="span2"&gt; &lt;!--Sidebar content--&gt; Search: &lt;input ng-model="query"&gt; Sort by: &lt;select ng-model="orderProp"&gt; &lt;option value="name"&gt;Alphabetical&lt;/option&gt; &lt;!--option value="age"&gt;Newest&lt;/option&gt; &lt;option value="-age"&gt;Oldest&lt;/option--&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="span10"&gt; &lt;!--Body content--&gt; &lt;ul class="documents"&gt; &lt;li ng-repeat="document in documents | orderBy:orderProp" class="thumbnail"&gt; &lt;a href="#/rest/{{document.document_id}}"&gt;{{document.title}}&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;pre&gt;{{ documents | json }}&lt;/pre&gt; &lt;/div&gt; </code></pre> <p>the Shttp call:</p> <pre><code> function DocListCtrl($scope, $http) { console.log('getting documents data'); $http.get('/*RESTful call here*/').success(function(data) { $scope.documents = data; }); $scope.orderProp = 'name'; } </code></pre> <p>when I run the page i get my list no problem using the</p> <pre><code>&lt;pre&gt;{{ documents | json }}&lt;/pre&gt; </code></pre> <p>but the ng-repeat fails to implement.</p> <p>EDIT</p> <p>here is an example of the Json I am working with.</p> <pre><code>{ "next": {}, "items": [ { "document_id": 3177554002, "title": "title of some item" } ] } </code></pre> <p>What exactly am I doing incorrectly with the ng-repeat call that fails to list my data the way i wish?</p> <p>Thanks for the help</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload