UPDATE:NG重複排序依據對象
我的HTML網頁上我使用如下所示:
<section ng-repeat="template in templates">
<ng-include src="template"></ng-include>
</section>
但問題是,我需要特定的文件在一定的順序等是有辦法我可以控制順序渲染的方式嗎?
我試圖排序依據的對象我怎麼做,我已經在這裏張貼之前在網上搜索。
function MyCtrl($scope) {
$scope.templates = {
template_address: "../template/address.html",
template_book: "../template/book.html",
template_create: "../template/create.html"
};
<div ng-app ng-controller="MyCtrl">
<ul>
<li ng-repeat="(name, path) in templates">{{name}}: {{path}}</li>
</ul>
</div>
http://jsfiddle.net/abuhamzah/6fbpdm9m/
按照什麼順序你試圖把他們嗎?他們已經準備好了。 – JLRishe 2014-12-13 01:43:31