mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
chore(button): use disabled property, not attr (#1782)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()',
|
||||
|
||||
Reference in New Issue
Block a user