ionic ion-refresher

<body ng-app="ccApp">
  <ion-content ng-controller="MyController">

      <!--
            做为 ionContent 或 ionScroll的子元素
            刷新完成以后,使用 $broadcast 广播 'scroll.refreshComplete'事件
            pulling-icon:下拉箭头样式,http://ionicons.com/网站获取相应的类名
            spinner:数据加载图标 http://ionicframework.com/docs/api/directive/ionSpinner/ 添加相应的类名
            on-pulling:往下拉取时执行的代码
            pulling-text:spinner下方显示的文字
            on-refresh:向下拉取刷新后执行的代码
      -->

      <ion-refresher
              refreshing-icon="crescent"
              disable-pulling-rotation=true
              pulling-icon="ion-ios-arrow-down"
              spinner="bubbles"
              on-pulling="doPulling()"
              pulling-text="数据正在加载中..."
              on-refresh="doRefresh()">

      </ion-refresher>
      
      <ion-list>
          <ion-item ng-repeat="item in items" ng-bind="item"></ion-item>
      </ion-list>
  </ion-content>
  <script type="text/javascript">
      angular.module('ccApp', ['ionic'])
              .controller('MyController', function($scope, $http) {
                  $scope.items = [1,2,3];
                  $scope.doRefresh = function() {

                      $scope.items = [1,2,3,4,5,6];
                      $scope.$broadcast('scroll.refreshComplete');
                  };
                  $scope.doPulling = function() {
                      console.log('你开始向下拉取了');
                  }
              });
  </script>

 

转载于:https://www.cnblogs.com/weats/p/4365909.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值