forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic-list.html
More file actions
61 lines (55 loc) · 1.73 KB
/
basic-list.html
File metadata and controls
61 lines (55 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html ng-app="ionic">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Sample UL</title>
<link href="/dist/css/ionic.css" rel="stylesheet">
<script src="/dist/js/ionic.bundle.js"></script>
<script src="stats.js"></script>
</head>
<body ng-controller="MainCtrl">
<ion-header-bar class="bar-positive">
<button class="button" ng-click="$root.showDelete = !$root.showDelete">Toggle Delete</button>
<h1 class="title">Basic List: Static Dimensions</h1>
<button class="button" ng-click="clearList()">Clear List</button>
</ion-header-bar>
<ion-content>
<h4 style="margin: 80px;">I have 80px margin</h4>
<ion-list>
<ion-item class="item card" collection-repeat="item in items" item-height="50px">
<ion-option-button>Button</ion-option-button>
<ion-delete-button class="ion-minus-circled" ng-click="items.splice($index, 1)"></ion-delete-button>
<h2>{{item.text}}</h2>
</ion-item>
</ion-list>
<h2>Stuff after list</h2>
<div class="card">Hello</div>
</ion-content>
<script>
angular.module('ionic').controller('MainCtrl',MainCtrl)
function MainCtrl($scope, $timeout) {
$scope.items = [];
function addImage() {
var i = $scope.items.length;
$scope.items.push({
text: 'Item ' + i,
image: 'http://placekitten.com/'+(100+50%i)+'/'+(100+50%i)
});
}
init();
$scope.clearList = function() {
$scope.items.length = 0;
init();
};
function init() {
$timeout(function() {
for (var i = 0; i < 100; i++) addImage();
}, 1000);
}
}
</script>
<style>
</style>
</body>
</html>