我正在尝试从名为“collections”的数组中提取所有项目。当我在HTML中输入调用时,我只在页面上看到数组中第一个项目的完整代码。我正在尝试仅提取“edm.preview”,即该项的图像。我正在使用Angular Firebase和名为Europeana的API。我的应用程序允许用户搜索并选择他们喜欢的图像,并将它们保存到特定的用户中。
这是js代码:
这是js代码:
$scope.users = fbutil.syncArray('users');
$scope.users.currentUser.collections = fbutil.syncArray('collections');
$scope.addSomething = function (something) {
var ref = fbutil.ref('users');
ref.child($rootScope.currentUser.uid).child('collections').push(something);
}
$scope.addSomething = function(item) {
if( newColItem ) {
// push a message to the end of the array
$scope.collections.$add(newColItem)
// display any errors
.catch(alert);
}
};
并且HTML:
<ul id="collections" ng-repeat="item in collections">
<li ng-repeat="item in collections">{{item.edmPreview}}</li>
</ul>