Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var myapp = angular.module('myApp',[]);
- myapp.controller('Controller', ['$scope', function($scope) {
- $scope.isLoading = false;
- }])
- .directive('progressButton', function(){
- return {
- restrict: 'E',
- scope: {
- className: '@',
- buttonText: '@',
- loading: '='
- },
- template: '<button type="button" ng-disabled="{{loading}}" class="{{className}}">{{buttonText}}</button>'
- }
- })
- // In HTML
- /*
- <div ng-controller="Controller">
- <progress-button loading="isLoading" button-text="Login" class-name="btn btn-primary"></progress-button>
- </div>
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement