0
我是新來的角和nedb。我試圖從一個nedb的數組中使用ng-repeat。 我不明白爲什麼我的代碼不工作使用nedb數組進行ng-repeat
<div ng-repeat="hello in helloworld"></div>
...
hellodb.find({}).sort({helloworld: 1}).exec(function (err, docs){
$scope.helloworld = docs;
console.log($scope.helloworld);
});
如果我做同樣的用相同的內容數據庫
$http.get('helloworld.json').success(function(data) {
$scope.helloworld = data;
console.log($scope.helloworld);
});
json文件,在控制檯輸出是相同和ng-repeat作品
非常感謝!它一直在困擾着我幾個小時..對於將來的引用,它是$ scope。$ apply() – user3320468