Skip to content

refactor: convert dash-case md-autosize to camelCase #2339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/input/autosize.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const textareaStyleReset = `

@Component({
template: `
<textarea mdTextareaAutosize [minRows]="minRows" [maxRows]="maxRows"
<textarea mdTextareaAutosize [mdAutosizeMinRows]="minRows" [mdAutosizeMaxRows]="maxRows"
#autosize="mdTextareaAutosize">
{{content}}
</textarea>`,
Expand Down
16 changes: 16 additions & 0 deletions src/lib/input/autosize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,25 @@ export class MdTextareaAutosize implements OnInit {
/** Minimum number of rows for this textarea. */
@Input() minRows: number;

get mdAutosizeMinRows(): number {
return this.minRows;
}

@Input() set mdAutosizeMinRows(value: number) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Input() should go on the getter. We should add that to the coding standards...

this.minRows = value;
}

/** Maximum number of rows for this textarea. */
@Input() maxRows: number;

get mdAutosizeMaxRows(): number {
return this.maxRows;
}

@Input() set mdAutosizeMaxRows(value: number) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit test needs to be updated as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean adding another part that checks that the old and the new api works?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test component in the spec still has minRows and maxRows. It should use the updated API.

this.maxRows = value;
}

/** Cached height of a textarea with a single row. */
private _cachedLineHeight: number;

Expand Down