我已经有这个工作在过去,我已经移动了关于localhost的网站,现在我似乎无法得到ng-repeat
来显示结果。有任何想法吗?Angular ng-repeat not loading
应用程序:
var app = angular.module('Search', ['ngResource']);
function seriesListCtrl ($scope, $http) {
// Set the defaults
$scope.url = '/order/series_list';
$scope.products = [];
// On Success add data to the products array
$scope.loadedItems = function (data, status) {
$scope.products = data;
$('.Initialloader').hide();
}
// Fetch the URL where the JSON array is
$scope.fetch = function() {
$('.Initialloader').show();
$http.get($scope.url).success($scope.loadedItems);
}
// Instantiate the process
$scope.fetch();
}
/顺序/ series_list加载在细。但是,这些数据似乎并未加载到范围内并重复。
HTML:
<div class="order_wrapper" ng-app="Search">
<div ng-controller="seriesListCtrl">
<div class="well">
<form class="form-inline">
<div class="col-lg-5"><input type="text" class="form-control" placeholder="Search Description" ng-model="query.series_description"></div>
<div class="col-lg-5"><input type="text" class="form-control" placeholder="Search Part Number/SKU" ng-model="query.product_sku"></div>
<button type="submit" class="btn btn-default"><i class="icon-search"></i> Search</button>
</form>
</div>
<div class="accordion" id="product_list">
<div class="accordion-group" ng-repeat="prod in products | filter:query">
<div class="accordion-heading order_listing">
<div class="row">
<div class="col-lg-2 image_container">
<img ng-src="{{prod.images_url}}" width="100px">
</div>
......... Extra blurb ........
</div>
</div>
</div>
</div>
</div>
AnjularJS 1.2.0 - 精加载
angularjs资源 - 精加载
所以只是为了确认:数据正在从加载/ order/series_list与$scope.fetch
,萤火虫表示该页面已被提取并包含内容。然后这应该将数据传递给$scope.loadedItems
,然后将其转到$scope.products
。
在html中,有一个ng-repeat
,然后应该循环产品中的所有产品。目前,我的.Initialloader
未被隐藏,ng-repeat
仍然隐藏。
我真的很感激你的帮助 - 我已经上了好几个小时,似乎无法弄清楚是什么导致了这个问题。
在此先感谢。
如果你想要模拟异步加载的工作演示,请发布你加载的Json数据 –