2018-02-10 15:18:01 +00:00
|
|
|
import ngModule from '../../module';
|
|
|
|
import template from './textarea.html';
|
2018-03-13 11:07:28 +00:00
|
|
|
import './style.scss';
|
2018-02-10 15:18:01 +00:00
|
|
|
|
|
|
|
directive.$inject = ['vnTemplate'];
|
|
|
|
export function directive(vnTemplate) {
|
|
|
|
return {
|
|
|
|
restrict: 'E',
|
|
|
|
template: (_, $attrs) =>
|
|
|
|
vnTemplate.getNormalized(template, $attrs, {
|
|
|
|
label: '',
|
|
|
|
rows: 3
|
|
|
|
}),
|
|
|
|
link: function(scope, element, attrs) {
|
|
|
|
scope.$watch(attrs.model, () => {
|
|
|
|
let mdlField = element[0].firstChild.MaterialTextfield;
|
|
|
|
if (mdlField)
|
|
|
|
mdlField.updateClasses_();
|
|
|
|
});
|
|
|
|
componentHandler.upgradeElement(element[0].firstChild);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
ngModule.directive('vnTextarea', directive);
|