mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
demo($ionicLoading): add basic demo
This commit is contained in:
47
js/angular/service/loading.js
vendored
47
js/angular/service/loading.js
vendored
@@ -30,6 +30,53 @@ var LOADING_SET_DEPRECATED = '$ionicLoading instance.setContent() has been depre
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
/**
|
||||
* @ngdoc demo
|
||||
* @name $ionicLoading#loadThemAll
|
||||
* @module loadingThemAll
|
||||
* @javascript
|
||||
* angular.module('loadingThemAll', ['ionic'])
|
||||
* .controller('LoadingCtrl', function($scope, $ionicLoading) {
|
||||
* $scope.loadingOptions = {
|
||||
* duration: 1000,
|
||||
* delay: 0,
|
||||
* template: '<i class="icon ion-loading-c"></i>\n<br/>\nLoading...',
|
||||
* noBackdrop: false
|
||||
* };
|
||||
* $scope.showLoading = function() {
|
||||
* $ionicLoading.show($scope.loadingOptions);
|
||||
* };
|
||||
* });
|
||||
* @html
|
||||
* <div ng-controller="LoadingCtrl">
|
||||
* <ion-header-bar class="bar-positive">
|
||||
* <h1 class="title">Loading Demo</h1>
|
||||
* <a class="button" ng-click="showLoading()">
|
||||
* <i class="icon ion-more"></i> Load
|
||||
* </a>
|
||||
* </ion-header-bar>
|
||||
* <ion-content>
|
||||
* <div class="list">
|
||||
* <label class="item item-input item-stacked-label">
|
||||
* <span class="input-label">Loading Duration (ms)</span>
|
||||
* <input type="number" ng-model="loadingOptions.duration">
|
||||
* </label>
|
||||
* <label class="item item-input item-stacked-label">
|
||||
* <span class="input-label">Loading Delay (ms)</span>
|
||||
* <input type="number" ng-model="loadingOptions.delay">
|
||||
* </label>
|
||||
* <label class="item item-input item-stacked-label">
|
||||
* <span class="input-label">Loading Template</span>
|
||||
* <textarea rows="3" ng-model="loadingOptions.template"></textarea>
|
||||
* </label>
|
||||
* <ion-toggle class="item item-toggle"
|
||||
* ng-model="loadingOptions.noBackdrop">
|
||||
* Hide Backdrop?
|
||||
* </ion-toggle>
|
||||
* </div>
|
||||
* </ion-content>
|
||||
* </div>
|
||||
*/
|
||||
IonicModule
|
||||
.factory('$ionicLoading', [
|
||||
'$document',
|
||||
|
||||
Reference in New Issue
Block a user