Angular-xeditable - How to change height of a Textarea as you type in?

309 views Asked by At

Recently I had a request to change the height of a Angular-xeditable TextArea as you type in, I've been trying to do a lot of changes to css but it doesn't work. Any help is highly appreciated.

1

There are 1 answers

0
Hung Vu On

Here is a solution for this that is to create your own directive on top of Angular-Xeditable. The key thing is when you use that directive and want to inject into Angular-Xeditable, you need to add the prefix "e-". For example, if you directive called "expanding", when you use that directive along with angular-xeditable, the directive name should be "e-expanding"

Have a look at my sample code below. Hope it helps Link to example code

       <h4>Angular-xeditable Textarea (Bootstrap 3)</h4>
       <div ng-app="app" ng-controller="Ctrl">
          <a href="#" editable-textarea="user.desc"  e-expanding >
          <pre>{{ user.desc || 'no description' }}</pre>
          </a>
        </div>