apollo_developers/assets/js/controllers/laddaCtrl.js
venbatechnologies@gmail.com 1809bcf9c9 fixed table for student details
2018-04-23 18:34:11 +05:30

29 lines
1.0 KiB
JavaScript
Executable File

'use strict';
/**
* controller for angular-ladda
* An angular directive wrapper for Ladda buttons.
*/
app.controller('LaddaCtrl', ["$scope", "$timeout", function ($scope, $timeout) {
$scope.ldloading = {};
$scope.clickBtn = function (style) {
$scope.ldloading[style.replace('-', '_')] = true;
$timeout(function () {
$scope.ldloading[style.replace('-', '_')] = false;
}, 2000);
};
$scope.clickProgressBtn = function (style) {
$scope.ldloading[style.replace('-', '_') + "_progress"] = true;
$timeout(function () {
$scope.ldloading[style.replace('-', '_') + "_progress"] = 0.1;
}, 500);
$timeout(function () {
$scope.ldloading[style.replace('-', '_') + "_progress"] += 0.1;
}, 1000);
$timeout(function () {
$scope.ldloading[style.replace('-', '_') + "_progress"] += 0.1;
}, 1500);
$timeout(function () {
$scope.ldloading[style.replace('-', '_') + "_progress"] = false;
}, 2000);
};
}]);