Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(button): fix error when md-button is disabled anchor
Browse files Browse the repository at this point in the history
attr.ngDisabled can't trackable by $watch without because it is not inside the scope.

Closes #1074.
  • Loading branch information
nikita-yaroshevich authored and ThomasBurleson committed Jan 8, 2015
1 parent b35be93 commit 48e5a8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/button/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function MdButtonDirective($mdInkRipple, $mdTheming, $mdAria) {
// For anchor elements, we have to set tabindex manually when the
// element is disabled
if (isAnchor(attr)) {
scope.$watch(attr.ngDisabled, function(isDisabled) {
scope.$watch(function() {return attr.ngDisabled;}, function(isDisabled) {
element.attr('tabindex', isDisabled ? -1 : 0);
});
}
Expand Down

0 comments on commit 48e5a8b

Please sign in to comment.