2019-10-09 22:47:29 +00:00
|
|
|
import ngModule from '../../module';
|
|
|
|
import Field from '../field';
|
|
|
|
|
|
|
|
export default class Textarea extends Field {
|
|
|
|
constructor($element, $scope, $compile) {
|
|
|
|
super($element, $scope, $compile);
|
|
|
|
|
|
|
|
let html = `<textarea ng-model="$ctrl.field"></textarea>`;
|
2019-10-28 20:40:24 +00:00
|
|
|
this.input = this.$compile(html)($scope)[0];
|
2019-10-09 22:47:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
set rows(value) {
|
|
|
|
this.input.rows = typeof value == 'number' && value > 0 ? value : 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
get rows() {
|
|
|
|
return this.input.rows;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngModule.vnComponent('vnTextarea', {
|
|
|
|
controller: Textarea,
|
|
|
|
bindings: {
|
|
|
|
rows: '<?'
|
|
|
|
}
|
|
|
|
});
|