Skip to content

Instantly share code, notes, and snippets.

@Zmaster
Zmaster / autoSizeInput.html
Created October 10, 2013 18:47
This is an AngularJS directive for having an automatically resizing text input that has two way data binding. Most of the credit goes to the plunkers in this questions (http://stackoverflow.com/questions/17410896/angularjs-directive-input-width-resize-by-keyup) for coming up with the starting point for the directive.
<span>
<input type="text" ng-model="value">
<span style="visibility:hidden; position:absolute; left:-1000; top:-1000;">{{value}}</span>
</span>