(function() { 'use strict'; /** * @ngdoc module * @name material.components.button * @description * * Button */ angular.module('material.components.button', [ 'material.core' ]) .directive('mdButton', MdButtonDirective); /** * @ngdoc directive * @name mdButton * @module material.components.button * * @restrict E * * @description * `` is a button directive with optional ink ripples (default enabled). * * If you supply a `href` or `ng-href` attribute, it will become an `` element. Otherwise, it will * become a `'; } function postLink(scope, element, attr) { var node = element[0]; $mdTheming(element); $mdInkRipple.attachButtonBehavior(scope, element); var elementHasText = node.textContent.trim(); if (!elementHasText) { $mdAria.expect(element, 'aria-label'); } // For anchor elements, we have to set tabindex manually when the // element is disabled if (isAnchor(attr) && angular.isDefined(attr.ngDisabled) ) { scope.$watch(attr.ngDisabled, function(isDisabled) { element.attr('tabindex', isDisabled ? -1 : 0); }); } } } })();