使用方法
angular.module('ionicApp', ['ionic'])
.controller('AppCtrl', function($scope, $timeout, $ionicLoading) {
// Setup the loader
$ionicLoading.show({
content: 'Loading',
animation: 'fade-in',
showBackdrop: false,
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);
方法
show(opts) 顯示加載提示
{string=} template html模闆
{string=} templateUrl 通過url加載模闆
{object=} scope 作用域. 預設是$rootScope.
{boolean=} noBackdrop Whether to hide the backdrop. By default it will be shown.
{boolean=} hideOnStateChange Whether to hide the loading spinner when navigating to a new state. Default false.
{number=} delay 延遲顯示,多少毫秒後顯示加載提示
{number=} duration 自動隐藏,多少毫秒後自動隐藏加載提示。預設是不自動隐藏
hide() 隐藏加載提示