I'm attempting to adjust the size of a textarea using AngularJS within a directive. I attach an attribute auto-resize
to my textarea
and define the directive as follows:
app.directive('autoResize', function() {
return {
restrict: 'A',
//scope: {},
replace: false,
link: function(scope, element, attrs) {
element.css({
'overflow': 'hidden',
'color': 'red',
'height': '50px'
});
}
}
}
The styles for color and overflow are applied successfully to the textarea, but the height remains unchanged at 50px.
If you have any insights or suggestions, they would be greatly appreciated.