Skip to content

Commit 8e5ae29

Browse files
author
zhangbo
committed
持续更新
1 parent c635bc6 commit 8e5ae29

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

demo/index.html

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@
1313
<h1 id="" class="text-center" style="margin: 100px;">
1414
{{title}}
1515
</h1>
16-
<button class="btn btn-success" style="margin-bottom: 15px;">查看浏览器network里的请求情况</button>
16+
<button class="btn btn-success" style="margin-bottom: 15px;" ng-click="vm.open()">开启测试</button>
1717
<div class="content">
18-
<img src="" ng-repeat="item in imgs track by $index" data-ui-lazyload="{{item}}" watch="watch"/>
18+
<input ng-model="vm.oldVal" ng-if="vm.start">
19+
<input ng-model="newVal" ng-if="vm.oldVal">
20+
</div>
21+
<div class="content">
22+
<input ng-model="vm.oldVal" ng-if="vm.start">
23+
<input ng-model="newVal" ng-if="vm.oldVal">
24+
</div>
25+
<div class="content">
26+
<input ng-model="vm.oldVal" ng-show="vm.start">
27+
<input ng-model="newVal" ng-show="vm.oldVal">
1928
</div>
2029
</body>
2130
</html>
@@ -24,16 +33,12 @@ <h1 id="" class="text-center" style="margin: 100px;">
2433
var app = angular.module('demo' , ['lazyload']);
2534
app.controller('demoCtro' , function($scope){
2635

27-
$scope.title = 'lazyload-directive';
28-
29-
$scope.watch = {};
30-
// 图片集合
31-
$scope.imgs = [];
36+
$scope.title = 'ng-if && ng-show';
37+
var vm = $scope.vm = {};
3238

33-
var url = 600;
34-
for(var i = 0; i< 20 ; i++ ){
35-
url ++ ;
36-
$scope.imgs.push('http://placekitten.com/'+url+'/300');
39+
vm.open = function(){
40+
vm.start = true;
3741
}
42+
3843
})
3944
</script>

0 commit comments

Comments
 (0)