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)
المعلمات نوع التفاصيل
الأراضي الفلسطينية المحتلة object

الخيار مؤشر التحميل. الخصائص المتوفرة:

  • {string=} template محتوى مؤشر أتش تي أم أل.
  • {string=} templateUrl قالب أتش تي أم أل تحميل رابط كمؤشر المحتوى.
  • {boolean=} noBackdrop هو الخلفية الخفية. افتراضيا، وسوف تظهر.
  • {number=} delay يعرض مؤشر كيفية تأخير العديد من ميلي ثانية. لا يتم تأخير الافتراضية.
  • {number=} duration تنتظر كم ميلي ثانية بعد مؤشر صناعة السيارات في إخفاء. افتراضيا، لا يزال مؤشر لعرضه حتى على الزناد .hide() .

إخفاء تأثير التحميل.

hide()

API

ممتلكات نوع التفاصيل
مندوب مقبض
(اختياري)
字符串

يتم تعريف مقبض مع $ionicListDelegate القائمة.

عرض-حذف
(اختياري)
布尔值

حذف قائمة زر من العناصر المعروضة حاليا أو خفية.

عرض-إعادة ترتيب
(اختياري)
布尔值

رتب قائمة زر البنود المعروضة حاليا أو مخفية.

يمكن، انتقد
(اختياري)
布尔值

ما إذا كان يسمح عنصر القائمة إلى الشريحة زر خيارات العرض. الافتراضي: صحيح.


أمثلة

كود 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>

شفرة جافا سكريبت

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 设置
  };
});