Skip to content

Commit

Permalink
fix(aot): change @inputs to not be private (#1289)
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn authored and kara committed Sep 21, 2016
1 parent ac86ddf commit b284dd4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()',
Expand All @@ -47,6 +46,7 @@ export class MdButton {

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

@Input()
get color(): string {
return this._color;
}
Expand Down
1 change: 1 addition & 0 deletions src/lib/sidenav/sidenav.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
9 changes: 6 additions & 3 deletions src/lib/sidenav/sidenav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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<void>();
Expand All @@ -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);
}


Expand Down

0 comments on commit b284dd4

Please sign in to comment.