Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandanmajeske/b7eff18c1bf24789e33c to your computer and use it in GitHub Desktop.
Save brandanmajeske/b7eff18c1bf24789e33c to your computer and use it in GitHub Desktop.
myApp.directive("autoGrow", function(){
return function(scope, element, attr){
var update = function(){
element.css("height", "auto");
element.css("height", element[0].scrollHeight + "px");
};
scope.$watch(attr.ngModel, function(){
update();
});
attr.$set("ngTrim", "false");
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment