AngularJS Based Loading Spinner&覆盖

时间:2017-06-11 05:29:00

标签: angularjs

我正在开发一个加载微调器,当我在控制器中包含微调器时工作正常,我正在使用以下http://angularscript.com/demo/angularjs-based-loading-spinner-overlay/

这是我的控制器

angular.module('app').controller('EmployeeController', function ($scope, appService) {

var employeesList = appService.GetEmployess();
$scope.spinner = {
    active: true
};
employeesList.then(function successCallback(response) {
    console.log(response.data);
    $scope.Employees = response.data;
    $scope.spinner = {
        active: false
    };
}, function errorCallback(response) {

});
});

这是初始加载时的加载方式 enter image description here

当我在成功回复中删除$scope.spinner时,这就是它的加载方式

var employeesList = appService.GetEmployess();
$scope.spinner = {
    active: true
};
employeesList.then(function successCallback(response) {
    console.log(response.data);
    $scope.Employees = response.data;

}, function errorCallback(response) {

});
});

enter image description here

我需要的是我想在中心屏幕上显示加载面板,我该如何实现,或者是否有任何其他加载面板。我的html如下

<body ng-controller="EmployeeController">
    <treasure-overlay-spinner active='spinner.active'>
        <table tr-ng-grid='' items='Employees' page-items="10"></table>
    </treasure-overlay-spinner>
</body>

0 个答案:

没有答案