Skip to content

Commit b284dd4

Browse files
jelbournkara
authored andcommitted
fix(aot): change @inputs to not be private (#1289)
1 parent ac86ddf commit b284dd4

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/lib/button/button.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {MdRippleModule} from '@angular2-material/core';
2121
moduleId: module.id,
2222
selector: 'button[md-button], button[md-raised-button], button[md-icon-button], ' +
2323
'button[md-fab], button[md-mini-fab]',
24-
inputs: ['color'],
2524
host: {
2625
'[class.md-button-focus]': '_isKeyboardFocused',
2726
'(mousedown)': '_setMousedown()',
@@ -47,6 +46,7 @@ export class MdButton {
4746

4847
constructor(private _elementRef: ElementRef, private _renderer: Renderer) { }
4948

49+
@Input()
5050
get color(): string {
5151
return this._color;
5252
}

src/lib/sidenav/sidenav.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ describe('MdSidenav', () => {
218218
it('should correctly parse opened="true"', () => {
219219
let fixture = TestBed.createComponent(SidenavSetToOpenedTrue);
220220
fixture.detectChanges();
221+
endSidenavTransition(fixture);
221222

222223
let sidenavEl = fixture.debugElement.query(By.css('md-sidenav')).nativeElement;
223224

src/lib/sidenav/sidenav.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
ViewEncapsulation,
1717
} from '@angular/core';
1818
import {CommonModule} from '@angular/common';
19-
import {Dir, MdError, BooleanFieldValue} from '@angular2-material/core';
19+
import {Dir, MdError} from '@angular2-material/core';
2020

2121
/** Exception thrown when two MdSidenav are matching the same side. */
2222
export class MdDuplicatedSidenavError extends MdError {
@@ -50,7 +50,7 @@ export class MdSidenav {
5050
@Input() mode: 'over' | 'push' | 'side' = 'over';
5151

5252
/** Whether the sidenav is opened. */
53-
@Input('opened') @BooleanFieldValue() private _opened: boolean = false;
53+
_opened: boolean = false;
5454

5555
/** Event emitted when the sidenav is being opened. Use this to synchronize animations. */
5656
@Output('open-start') onOpenStart = new EventEmitter<void>();
@@ -75,9 +75,12 @@ export class MdSidenav {
7575
* Whether the sidenav is opened. We overload this because we trigger an event when it
7676
* starts or end.
7777
*/
78+
@Input()
7879
get opened(): boolean { return this._opened; }
7980
set opened(v: boolean) {
80-
this.toggle(v);
81+
// TODO(jelbourn): this coercion goes away when BooleanFieldValue is removed.
82+
let booleanValue = v != null && `${v}` !== 'false';
83+
this.toggle(booleanValue);
8184
}
8285

8386

0 commit comments

Comments
 (0)