ionic刷新
来源:互联网 发布:江国香织 知乎 编辑:程序博客网 时间:2024/05/17 23:33
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title></title>
<link rel="stylesheet" href="css/ionic.css" />
<script type="text/javascript" src="js/ionic.bundle.min.js"></script>
</head>
<body ng-app="myapp" ng-controller="cre">
<!--头部-->
<ion-header-bar class="bar-positive">
<h1 class="title">下拉刷新</h1>
</ion-header-bar>
<!--内容-->
<ion-content>
<!--下拉刷新-->
<ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()" pulling-icon="img/alert.png"></ion-refresher>
<ul class="list">
<li class="item" ng-repeat="x in names track by $index">{{x}}</li>
</ul>
</ion-content>
<ion-footer-bar class="bar-positive">
<h2 class="title">上拉加载</h2>
</ion-footer-bar>
</body>
<script type="text/javascript">
//注入
var mo = angular.module("myapp", ["ionic"]);
//创建控制器
mo.controller("cre", function($scope,$http) {
//定义数组
$scope.names = ['张三',"李四","王五","买六"];
//获取数据的方法
$scope.doRefresh=function(){
$http.get("dat/data1.json").then(function(red){
//获取json里的内容
var name1=red.data;
for(var i=0;i<name1.length;i++){
//放到数组里
$scope.names.push(name1[i].name);
}
//停止刷新//发送广播
$scope.$broadcast('scroll.refreshComplete');
},function(req){
//停止刷新
$scope.$broadcast('scroll.refreshComplete');
}).finally(function(){
//停止刷新
$scope.$broadcast('scroll.refreshComplete');
});
}
})
</script>
</html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title></title>
<link rel="stylesheet" href="css/ionic.css" />
<script type="text/javascript" src="js/ionic.bundle.min.js"></script>
</head>
<body ng-app="myapp" ng-controller="cre">
<!--头部-->
<ion-header-bar class="bar-positive">
<h1 class="title">下拉刷新</h1>
</ion-header-bar>
<!--内容-->
<ion-content>
<!--下拉刷新-->
<ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()" pulling-icon="img/alert.png"></ion-refresher>
<ul class="list">
<li class="item" ng-repeat="x in names track by $index">{{x}}</li>
</ul>
</ion-content>
<ion-footer-bar class="bar-positive">
<h2 class="title">上拉加载</h2>
</ion-footer-bar>
</body>
<script type="text/javascript">
//注入
var mo = angular.module("myapp", ["ionic"]);
//创建控制器
mo.controller("cre", function($scope,$http) {
//定义数组
$scope.names = ['张三',"李四","王五","买六"];
//获取数据的方法
$scope.doRefresh=function(){
$http.get("dat/data1.json").then(function(red){
//获取json里的内容
var name1=red.data;
for(var i=0;i<name1.length;i++){
//放到数组里
$scope.names.push(name1[i].name);
}
//停止刷新//发送广播
$scope.$broadcast('scroll.refreshComplete');
},function(req){
//停止刷新
$scope.$broadcast('scroll.refreshComplete');
}).finally(function(){
//停止刷新
$scope.$broadcast('scroll.refreshComplete');
});
}
})
</script>
</html>
阅读全文
0 0
- ionic刷新
- ionic 下拉刷新
- AngularJS + Ionic 下拉刷新
- ionic state 缓存刷新
- ionic 下拉刷新
- ionic中定时刷新
- ionic refresher(下拉刷新)
- ionic 下拉刷新
- ionic局部刷新
- ionic自动刷新
- ionic下拉刷新
- Ionic 下拉刷新
- ionic的下拉刷新
- ionic 下拉刷新
- ionic下来刷新
- ionic实现下拉刷新
- ionic刷新的代码
- ionic 下拉刷新
- 文章标题
- Linux——iscsi共享硬件
- 使用DBUtils获取Blob类型数据
- angular学习
- OPENCV 通过Mat访问每个像素
- ionic刷新
- Fastjson SerializerFeature详解
- RabbitMQ消息队列-Centos7下安装RabbitMQ3.6.1
- java线程---基础(二)
- cmd进入指定盘符
- Delphi-字符串函数
- 第6章 持续构建
- 论为什么需要软件工程
- Educational Codeforces Round 34