title: Autosizing not expanding box size in angular
body: <p>So I'm working on an autosizing function for textareas to create a nice UI experience, and I'm having an issue with a set up that I found.</p>
  
  <p>I found this working version online here:</p>
  
  <p><a href="http://www.brianchu.com/blog/2013/11/02/creating-an-auto-growing-text-input/" rel="nofollow noreferrer">http://www.brianchu.com/blog/2013/11/02/creating-an-auto-growing-text-input/</a></p>
  
  <p>Clearly you can see that this works. So I converted it over to angular, and have been messing around with it, but I'm not exactly sure what I am doing that is incorrect. </p>
  
  <p>I'm working with it as a directive, and I'm running all the code on compile, so that should be putting all the elements and objects together smoothly shouldn't it?</p>
  
  <p>I've placed my "in-progress" code below along with the location of the fiddle where I've been spit balling all this. </p>
  
  <p><strong>fiddle</strong></p>
  
  <p><a href="https://jsfiddle.net/Mr_Pikachu/snszc0Lu/4/" rel="nofollow noreferrer">https://jsfiddle.net/Mr_Pikachu/snszc0Lu/4/</a></p>
  
  <p><strong>Current Code</strong></p>
  
  <pre><code>var a = angular.module('app', []);
  a.directive('autoGrow', function($log, $compile, $document){
      return {
          compile : function(elem, attrs){
  
              // define variable and function
              var textContainer, textareaSize, input;
  
  
              // set the parent class and recompile
              input = angular.element('&lt;textarea class="textarea-autogrow"&gt;&lt;/textarea&gt;');
              textareaSize = angular.element('&lt;div class="textarea-size"&gt;&lt;/div&gt;');
              elem.append(input);
              elem.append(textareaSize);
              elem.addClass('textarea-container');
  
              var autoSize = function(){
                  $log.log('fired');
                  textareaSize.innerHTML = input.value + "\n";
              };
              autoSize();
              input.bind('input', autoSize);
          }
      };
  });
  </code></pre>