Skip to content

Commit de64d33

Browse files
committed
fix: #216 - review that properties that are accessed from template are public
1 parent fb51519 commit de64d33

16 files changed

+24
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This package assumes that you are building an Angular2 app with TypeScript. Angu
2020
**Here is a plnkr if you'd like to play around http://plnkr.co/edit/I3dLfLUDIH2xlEJqj0da?p=preview.**
2121

2222

23-
### Status of the npm package version 2.0 (mdl version 1.2.1; angular 2.0 final)
23+
### Status of the npm package version 2 (mdl version 1.2.1; angular 2 final)
2424

2525
- Badges
2626
- Buttons

src/lib/components/badge/mdl-badge.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class MdlBadgeDirective implements OnChanges {
1818

1919
private el: HTMLElement;
2020

21-
@Input('mdl-badge') private mdlBadgeContent: string;
21+
@Input('mdl-badge') public mdlBadgeContent: string;
2222

2323
constructor(private elementRef: ElementRef, private renderer: Renderer) {
2424
this.el = elementRef.nativeElement;

src/lib/components/button/mdl-button.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export class MdlButtonComponent implements OnChanges {
6060

6161
private element: HTMLElement;
6262

63-
@Input('mdl-button-type') private mdlButtonType: 'raised' | 'fab' | 'mini-fab' | 'icon' | '' ;
64-
@Input('mdl-colored') private mdlColoredType: 'primary' | 'accent' | '';
63+
@Input('mdl-button-type') public mdlButtonType: 'raised' | 'fab' | 'mini-fab' | 'icon' | '' ;
64+
@Input('mdl-colored') public mdlColoredType: 'primary' | 'accent' | '';
6565
@Input() @BooleanProperty() public disabled = false;
6666

6767
constructor(public elementRef: ElementRef, private renderer: Renderer) {

src/lib/components/checkbox/mdl-checkbox.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class MdlCheckboxComponent implements ControlValueAccessor {
5757

5858
@Input() @BooleanProperty() public disabled = false;
5959

60-
private change: EventEmitter<boolean> = new EventEmitter<boolean>();
60+
public change: EventEmitter<boolean> = new EventEmitter<boolean>();
6161

6262
private value_: boolean = false;
6363

src/lib/components/chips/mdl-chip.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export class MdlChipComponent {
2828

2929
@Input('mdl-label') public mdlLabel;
3030
@Input('mdl-action-icon') public mdlActionIcon;
31-
@Output('action-click') private actionClick = new EventEmitter();
32-
@ContentChild(MdlChipContactDirective) protected chipContact: MdlChipContactDirective;
31+
@Output('action-click') public actionClick = new EventEmitter();
32+
@ContentChild(MdlChipContactDirective) public chipContact: MdlChipContactDirective;
3333

3434
public action() {
3535
this.actionClick.emit();

src/lib/components/common/mdl-ripple.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
import { MaterialRipple } from './ripple.vendor';
1313

1414
// known bugs: https://github.com/google/material-design-lite/issues/4215
15-
export class MdlRippleDirective implements OnChanges{
15+
export class MdlRippleDirective implements OnChanges {
1616

1717
private RIPPLE = 'mdl-ripple';
1818

src/lib/components/layout/mdl-layout-content.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class MdlLayoutContentComponent {
2020

2121
@ContentChildren(MdlLayoutTabPanelComponent) public tabs: QueryList<MdlLayoutTabPanelComponent>;
2222

23-
protected el: HTMLElement;
23+
public el: HTMLElement;
2424

2525
constructor(private elRef: ElementRef) {
2626
this.el = elRef.nativeElement;

src/lib/components/layout/mdl-layout-header.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class MdlLayoutHeaderComponent {
5353

5454
// set from MdlLayoutComponent
5555
public mode: string;
56-
protected el: HTMLElement;
56+
public el: HTMLElement;
5757
public isCompact = false;
5858
public isAnimating = false;
5959
public isSeamed = false;

src/lib/components/layout/mdl-layout.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ export class MdlLayoutComponent implements AfterContentInit, OnDestroy, OnChange
7474
@Input('mdl-layout-fixed-header') @BooleanProperty() public isFixedHeader = false;
7575
@Input('mdl-layout-header-seamed') @BooleanProperty() public isSeamed = false;
7676
@Input('mdl-layout-tab-active-index') @NumberProperty() public selectedIndex: number = 0;
77-
@Input('mdl-ripple') @BooleanProperty() protected isRipple = false;
77+
@Input('mdl-ripple') @BooleanProperty() public isRipple = false;
7878
@Input('mdl-layout-no-drawer-button') @BooleanProperty() public isNoDrawer = false;
7979
@Output('mdl-layout-tab-active-changed') public selectedTabEmitter = new EventEmitter();
8080
@Output('mdl-layout-tab-mouseover') public mouseoverTabEmitter = new EventEmitter();
8181
@Output('mdl-layout-tab-mouseout') public mouseoutTabEmitter = new EventEmitter();
8282

83-
@Output('open') onOpen = new EventEmitter<void>();
84-
@Output('close') onClose = new EventEmitter<void>();
83+
@Output('open') public onOpen = new EventEmitter<void>();
84+
@Output('close') public onClose = new EventEmitter<void>();
8585

8686
public isDrawerVisible = false;
8787
public isSmallScreen = false;

src/lib/components/list/mdl-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class MdlListComponent {}
4444
})
4545
export class MdlListItemComponent implements OnInit, OnChanges {
4646

47-
@Input() @NumberProperty() private lines: number = 1;
47+
@Input() @NumberProperty() public lines: number = 1;
4848

4949
constructor(@Optional() private mdlListComponent: MdlListComponent) {}
5050

src/lib/components/menu/mdl-menu.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class MdlMenuComponent implements OnInit, AfterViewInit, OnDestroy {
9494

9595
@ContentChildren(MdlMenuItemComponent) private menuItemComponents: QueryList<MdlMenuItemComponent>;
9696

97-
private cssPosition = 'mdl-menu--bottom-left';
97+
public cssPosition = 'mdl-menu--bottom-left';
9898

9999
private isVisible = false;
100100

src/lib/components/menu/mdl-toggle-menu.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import { MdlButtonComponent } from '../button/mdl-button.component';
99
})
1010
export class MdlToggleMenuDirective {
1111

12-
@Input('mdl-toggle-menu') menu: MdlMenuComponent;
12+
@Input('mdl-toggle-menu') public menu: MdlMenuComponent;
1313

1414
constructor(private button: MdlButtonComponent){}
1515

1616
@HostListener('click', ['$event'])
1717
public onClick($event){
1818
this.menu.toggle($event, this.button);
1919
}
20-
}
20+
}

src/lib/components/spinner/mdl-spinner.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { CommonModule } from '@angular/common';
3030
encapsulation: ViewEncapsulation.None
3131
})
3232
export class MdlSpinnerComponent {
33-
protected layers = [1, 2, 3, 4];
33+
public layers = [1, 2, 3, 4];
3434

3535
@Input() @BooleanProperty() public active: boolean;
3636
@Input('single-color') @BooleanProperty() public singleColor: boolean;

src/lib/components/table/mdl-table.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class MdlTableComponent {
8585

8686
@Input('table-model') public model: IMdlTableModel;
8787

88-
protected selectable = false;
88+
public selectable = false;
8989
}
9090

9191

@@ -101,8 +101,8 @@ export class MdlSelectableTableComponent extends MdlTableComponent {
101101
@Input('table-model-selected') public selected: Array<IMdlTableModelItem>;
102102
@Output('table-model-selectionChanged') public selectionChange = new EventEmitter();
103103

104-
protected selectable = true;
105-
protected allSelected = false;
104+
public selectable = true;
105+
public allSelected = false;
106106

107107
public isAllSelected() {
108108
return this.model.data.every( data => data.selected);

src/lib/components/tabs/mdl-tabs.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class MdlTabsComponent implements AfterContentInit, OnChanges {
6969
}
7070
}
7171

72-
protected tabSelected(tab: MdlTabPanelComponent) {
72+
public tabSelected(tab: MdlTabPanelComponent) {
7373
if (tab.disabled) {
7474
return;
7575
}

src/lib/components/textfield/mdl-textfield.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ export class MdlTextFieldComponent implements ControlValueAccessor, OnChanges, D
130130
private el: HTMLElement;
131131

132132
@Output('blur')
133-
private blurEmitter: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
133+
public blurEmitter: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
134134

135135
@Output('focus')
136-
private focusEmitter: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
136+
public focusEmitter: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
137137

138138
@ViewChild('input') private inputEl: ElementRef;
139139

0 commit comments

Comments
 (0)