Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. var myapp = angular.module('myApp',[]);
  2.  
  3. myapp.controller('Controller', ['$scope', function($scope) {
  4. $scope.isLoading = false;
  5.  
  6. }])
  7. .directive('progressButton', function(){
  8. return {
  9. restrict: 'E',
  10. scope: {
  11. className: '@',
  12. buttonText: '@',
  13. loading: '='
  14. },
  15. template: '<button type="button" ng-disabled="{{loading}}" class="{{className}}">{{buttonText}}</button>'
  16. }
  17. })
  18.  
  19. // In HTML
  20. /*
  21. <div ng-controller="Controller">
  22. <progress-button loading="isLoading" button-text="Login" class-name="btn btn-primary"></progress-button>
  23. </div>
  24. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement