diff --git a/src/lib/button/button.ts b/src/lib/button/button.ts index 253fb6f911b0..df523a339b9d 100644 --- a/src/lib/button/button.ts +++ b/src/lib/button/button.ts @@ -21,7 +21,6 @@ import {MdRippleModule} from '@angular2-material/core'; moduleId: module.id, selector: 'button[md-button], button[md-raised-button], button[md-icon-button], ' + 'button[md-fab], button[md-mini-fab]', - inputs: ['color'], host: { '[class.md-button-focus]': '_isKeyboardFocused', '(mousedown)': '_setMousedown()', @@ -47,6 +46,7 @@ export class MdButton { constructor(private _elementRef: ElementRef, private _renderer: Renderer) { } + @Input() get color(): string { return this._color; } diff --git a/src/lib/sidenav/sidenav.spec.ts b/src/lib/sidenav/sidenav.spec.ts index d2d5e36d0460..7b56aa9fbe3c 100644 --- a/src/lib/sidenav/sidenav.spec.ts +++ b/src/lib/sidenav/sidenav.spec.ts @@ -218,6 +218,7 @@ describe('MdSidenav', () => { it('should correctly parse opened="true"', () => { let fixture = TestBed.createComponent(SidenavSetToOpenedTrue); fixture.detectChanges(); + endSidenavTransition(fixture); let sidenavEl = fixture.debugElement.query(By.css('md-sidenav')).nativeElement; diff --git a/src/lib/sidenav/sidenav.ts b/src/lib/sidenav/sidenav.ts index eda8dd5daa05..06e82339e0d1 100644 --- a/src/lib/sidenav/sidenav.ts +++ b/src/lib/sidenav/sidenav.ts @@ -16,7 +16,7 @@ import { ViewEncapsulation, } from '@angular/core'; import {CommonModule} from '@angular/common'; -import {Dir, MdError, BooleanFieldValue} from '@angular2-material/core'; +import {Dir, MdError} from '@angular2-material/core'; /** Exception thrown when two MdSidenav are matching the same side. */ export class MdDuplicatedSidenavError extends MdError { @@ -50,7 +50,7 @@ export class MdSidenav { @Input() mode: 'over' | 'push' | 'side' = 'over'; /** Whether the sidenav is opened. */ - @Input('opened') @BooleanFieldValue() private _opened: boolean = false; + _opened: boolean = false; /** Event emitted when the sidenav is being opened. Use this to synchronize animations. */ @Output('open-start') onOpenStart = new EventEmitter(); @@ -75,9 +75,12 @@ export class MdSidenav { * Whether the sidenav is opened. We overload this because we trigger an event when it * starts or end. */ + @Input() get opened(): boolean { return this._opened; } set opened(v: boolean) { - this.toggle(v); + // TODO(jelbourn): this coercion goes away when BooleanFieldValue is removed. + let booleanValue = v != null && `${v}` !== 'false'; + this.toggle(booleanValue); }