From 48e5a8bc365e89f1d0446758a7211f5773956443 Mon Sep 17 00:00:00 2001 From: Nikita Date: Wed, 31 Dec 2014 02:11:24 +0300 Subject: [PATCH] fix(button): fix error when md-button is disabled anchor attr.ngDisabled can't trackable by $watch without because it is not inside the scope. Closes #1074. --- src/components/button/button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/button/button.js b/src/components/button/button.js index ac40d1ef925..d7346e3e7f3 100644 --- a/src/components/button/button.js +++ b/src/components/button/button.js @@ -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); }); }