javascript - Ng-repeat isn't reading from the scope? -


i work angular & ng-repeat @ work, why perplexed why won't render. it's silly i'm overlooking, i've spent enough time on it merits asking else hint.

the relevant bits:

js

  .controller('listctrl', function($scope, dataapi){     dataapi.getindex().then(function(res) {       console.log('server response', res);       $scope.notes = res;     }); 

jade

  h1 hello list   div(ng-controller='listctrl')     div(ng-repeat='note in notes')       div {{ note.dist_path }} 

the console log of data loaded (array of objects)

server response [object, object, object, object] 

no errors in console. inspect scope, , see expect. object of arrays.

the problem dataapi method getindex using external library (q) resolve request, rather leaving angular's $http , $q. needed call $scope.$apply() after setting scope variable alert angular of change. or use angular's built in $q or work promise returned $http.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -