ionic refresh_refresh plus使用说明_refreshment翻译(2)

电脑杂谈  发布时间:2017-05-18 03:10:39  来源:网络整理

红色是我们添加代码

我们在'<i class="icon {{pullingIcon}}"></i>' 添加style="color:{{pullingIconColor}}",变成

<i class="icon {{pullingIcon}}" style="color:{{pullingIconColor}}"></i>

在<i ng-if="showIcon" class="icon {{refreshingIcon}}"></i>中添加style="color:{{refreshingIconColor}}",最终变成<i ng-if="showIcon" class="icon {{refreshingIcon}}" style="color:{{refreshingIconColor}}"></i>

(2)再找到$ionicRefresher这个控制器,代码如下:

IonicModule
.controller('$ionicRefresher', [
  '$scope',
  '$attrs',
  '$element',
  '$ionicBind',
  '$timeout',
  function($scope, $attrs, $element, $ionicBind, $timeout) {
    var self = this,
        isDragging = false,
        isOverscrolling = false,
        dragOffset = 0,
        lastOverscroll = 0,
        ptrThreshold = 60,
        activated = false,
        scrollTime = 500,
        startY = null,
        deltaY = null,
        canOverscroll = true,
        scrollParent,
        scrollChild;

    if (!isDefined($attrs.pullingIcon)) {
      $attrs.$set('pullingIcon', 'ion-android-arrow-down');
    }

    if (!isDefined($attrs.refreshingIconColor)) {
      $attrs.$set('refreshingIconColor', 'none');
    }

    if (!isDefined($attrs.refreshingIconColor)) {
      $attrs.$set('pullingIconColor', 'none');
    }

    $scope.showSpinner = !isDefined($attrs.refreshingIcon) && $attrs.spinner != 'none';

    $scope.showIcon = isDefined($attrs.refreshingIcon);

    $ionicBind($scope, $attrs, {
      pullingIcon: '@',
      pullingIconColor: '@',
      pullingText: '@',
      refreshingIcon: '@',
      refreshingIconColor: '@',
      refreshingText: '@',
      spinner: '@',
      disablePullingRotation: '@',
      $onRefresh: '&onRefresh',
      $onPulling: '&onPulling'
    });
........
添加了一下代码


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-47765-2.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...