apollo_developers/assets/js/controllers/laddaCtrl.js
saravanakumar_kandasami a11795c215 SIT code
2018-04-19 18:17:06 +05:30

29 lines
1.0 KiB
JavaScript

'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);
};
}]);