diff --git a/src/lib/button/button.spec.ts b/src/lib/button/button.spec.ts index 0144fcf7843d..901643347a9b 100644 --- a/src/lib/button/button.spec.ts +++ b/src/lib/button/button.spec.ts @@ -80,6 +80,16 @@ describe('MdButton', () => { expect(testComponent.clickCount).toBe(0); }); + it('should disable the native button element', () => { + let fixture = TestBed.createComponent(TestApp); + let buttonNativeElement = fixture.nativeElement.querySelector('button'); + expect(buttonNativeElement.disabled).toBeFalsy('Expected button not to be disabled'); + + fixture.componentInstance.isDisabled = true; + fixture.detectChanges(); + expect(buttonNativeElement.disabled).toBeTruthy('Expected button to be disabled'); + }); + }); // Anchor button tests diff --git a/src/lib/button/button.ts b/src/lib/button/button.ts index ef280cbc4afc..3ea49d04bf70 100644 --- a/src/lib/button/button.ts +++ b/src/lib/button/button.ts @@ -21,7 +21,7 @@ import {MdRippleModule, coerceBooleanProperty} from '../core'; selector: 'button[md-button], button[md-raised-button], button[md-icon-button], ' + 'button[md-fab], button[md-mini-fab]', host: { - '[attr.disabled]': 'disabled', + '[disabled]': 'disabled', '[class.md-button-focus]': '_isKeyboardFocused', '(mousedown)': '_setMousedown()', '(focus)': '_setKeyboardFocus()',