Latest web development tutorials

イオン負荷運転

$ IonicLoadingは、デフォルトの相互作用の効果イオン負荷です。 また、内部のテンプレート内部の内容を変更することができます。

使用法

angular.module('LoadingApp', ['ionic'])
.controller('LoadingCtrl', function($scope, $ionicLoading) {
  $scope.show = function() {
    $ionicLoading.show({
      template: 'Loading...'
    });
  };
  $scope.hide = function(){
    $ionicLoading.hide();
  };
});

ウェイ

ローディング効果を表示します。

show(opts)
パラメータ タイプ 詳細
optsの object

ローディングインジケータオプション。 利用可能なプロパティ:

  • {string=} templateインジケータHTMLコンテンツ。
  • {string=} templateUrlコンテンツ指標として負荷のURLのHTMLテンプレート。
  • {boolean=} noBackdrop隠された背景です。 デフォルトでは、それが表示されます。
  • {number=} delay時間をミリ秒単位で遅らせる方法インジケータが表示されます。 デフォルトでは、遅延されません。
  • {number=} duration自動非表示インジケータの後に何ミリ秒待ちます。 デフォルトでは、インジケータがトリガされるまで表示し続け.hide()

ローディング効果を非表示にします。

hide()

API

プロパティ タイプ 詳細
デリゲートハンドル
(オプション)
字符串

ハンドルは、と定義されている$ionicListDelegateリスト。

ショー削除
(オプション)
布尔值

現在表示されているか、隠されたアイテムのボタンリストを削除します。

ショーリオーダー
(オプション)
布尔值

ソートボタンリストの項目は、現在表示されているか、隠されました。

缶スワイプ
(オプション)
布尔值

リスト項目を表示オプションボタンをスライドさせることができるかどうか。 デフォルト:true。


HTMLコード:

<html ng-app="ionicApp">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> 
    
    <title>Ionic Modal</title>

     <link href="http://www.w3big.com/static/ionic/css/ionic.min.css" rel="stylesheet">
    <script src="http://www.w3big.com/static/ionic/js/ionic.bundle.min.js"></script>
  </head>
  <body ng-controller="AppCtrl">
    
      <ion-view title="Home">
        <ion-header-bar>
          <h1 class="title">The Stooges</h1>
        </ion-header-bar>
        <ion-content has-header="true">
          <ion-list>
            <ion-item ng-repeat="stooge in stooges" href="#">{{stooge.name}}</ion-item>
          </ion-list>
        </ion-content>
      </ion-view>
    
  </body>
</html>

JavaScriptコード

angular.module('ionicApp', ['ionic'])
.controller('AppCtrl', function($scope, $timeout, $ionicLoading) {

  // Setup the loader
  $ionicLoading.show({
    content: 'Loading',
    animation: 'fade-in',
    showBackdrop: true,
    maxWidth: 200,
    showDelay: 0
  });
  
  // Set a timeout to clear loader, however you would actually call the $ionicLoading.hide(); method whenever everything is ready or loaded.
  $timeout(function () {
    $ionicLoading.hide();
    $scope.stooges = [{name: 'Moe'}, {name: 'Larry'}, {name: 'Curly'}];
  }, 2000);
  
});


$ IonicLoadingConfig

ロードするために、デフォルトのオプションを設定します。

使用法:

var app = angular.module('myApp', ['ionic'])
app.constant('$ionicLoadingConfig', {
  template: '默认加载模板……'
});
app.controller('AppCtrl', function($scope, $ionicLoading) {
  $scope.showLoading = function() {
    $ionicLoading.show(); //配置选项在 $ionicLoadingConfig 设置
  };
});