refactor: changed minRows and maxRows to mdAutosizeMinRows and mdAutosizeMaxRows (#2339)

- left minRows and maxRows to not break old versions
This commit is contained in:
Elad Bezalel
2017-01-12 23:23:54 +02:00
committed by tinayuangao
parent d7831d9018
commit 080f570958
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ const textareaStyleReset = `
@Component({
template: `
<textarea mdTextareaAutosize [minRows]="minRows" [maxRows]="maxRows"
<textarea mdTextareaAutosize [mdAutosizeMinRows]="minRows" [mdAutosizeMaxRows]="maxRows"
#autosize="mdTextareaAutosize">
{{content}}
</textarea>`,
+16
View File
@@ -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) {
this.minRows = value;
}
/** Maximum number of rows for this textarea. */
@Input() maxRows: number;
get mdAutosizeMaxRows(): number {
return this.maxRows;
}
@Input() set mdAutosizeMaxRows(value: number) {
this.maxRows = value;
}
/** Cached height of a textarea with a single row. */
private _cachedLineHeight: number;