angularjs 排序入门学习

 

 

 

 

 

 

 

 

 

<!DOCTYPE html>
<html ng-app="myApp">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width,height=device-height">
    <!--<script src="public/js/jquery.js"></script>-->
    <script src="../public/ionic/js/ionic.bundle.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../public/ionic/css/ionic.min.css">
</head>
<body ng-controller="myCtrl">


<span ng-repeat="item in lists">
    <div>{{item.id}} ---- {{item.name}}</div>
</span>


</body>
</html>

<script>


angular.module('myApp', ['ionic'])
.controller('myCtrl', function($scope,$ionicModal,$q,$http) {

	var myArrayData = [{
		"id": 35,
		"name": "单人床",
		"price": 100,
		"unit": "套",
		"num": 0,
		"icon": "/Public/Static/Wap/V20/img/icon/cccm/drc.jpg"
	},
		{
			"id": 36,
			"name": "双人床",
			"price": 150,
			"unit": "套",
			"num": 0,
			"icon": "/Public/Static/Wap/V20/img/icon/cccm/src.jpg"
		},
		{
			"id": 37,
			"name": "沙发",
			"price": 150,
			"unit": "套",
			"num": 0,
			"icon": "/Public/Static/Wap/V20/img/icon/cccm/sf.jpg"
		},
		{
			"id": 38,
			"name": "窗帘",
			"price": 15,
			"unit": "平米",
			"num": 0,
			"icon": "/Public/Static/Wap/V20/img/icon/cccm/cl.jpg"
		},
		{
			"id": 39,
			"name": "地毯",
			"price": 20,
			"unit": "平米",
			"num": 0,
			"icon": "/Public/Static/Wap/V20/img/icon/cccm/dt.jpg"
		}];

	$scope.lists =myArrayData;

});

</script>

 

 

 

 

 

 

 

你可能感兴趣的:(angularjs 排序入门学习)