/** * A directive for super tiny implementation of Ladda. */ angular.module('fr.ladda', []).directive('frLadda', [function () { return { restrict: 'A', link: function (scope, element, attrs) { var spinner; scope.$watch(attrs.frLadda, function (newValue) { if (newValue == true) { spinner = angular.element(''); element.append(spinner); element.attr('disabled', 'disabled'); } else if (spinner) { spinner.remove(); element.removeAttr('disabled'); } }); }, }; }]);