title: textarea value in angularjs
body: <p>I know it is similar to <a href="https://stackoverflow.com/questions/23294691/cant-getting-textarea-value-using-angularjs">this</a> In controller below  I don't know how to get textarea value. In jquery I would just do  $("#textarea1").val(); but can't do it here. Also if I create new model i.e.note for textarea I can refer to it as $scope.note bit still don't know what how to make assign textarea to  it.</p>
  
  <pre><code>var app = angular.module("angularApp", []).controller("myConfigGenCtrl", function($scope) {
      $scope.textarea1 ="";
      $scope.clear = function() {
          $scope.textarea1 = "";
      };
      $scope.save  = function(data, filename) {
          data = $scope.textarea1;
          var blob = new Blob([data], {type: "text/plain;charset=utf-8"});
          filename = "textarea.txt";
          console.log($scope.textarea1);
          saveAs(blob, filename);
      };
  });
  </code></pre>
  
  <p>Here is html</p>
  
  <pre><code>&lt;body ng-app="angularApp"&gt;
      &lt;div ng-controller="myConfigGenCtrl"&gt;
          &lt;form name="myform"&gt;
              &lt;input type="text" ng-model="message1"/&gt;
              &lt;input type="text" ng-model="message2"/&gt;
          &lt;/form&gt;
  
          &lt;p&gt;
              &lt;textarea id="textarea1" cols="80" rows="10"&gt;
                  This is {{message1}} in 1st line
                  This is {{message2}} in lastst line
              &lt;/textarea&gt;
          &lt;/p&gt;
          &lt;p&gt;
              &lt;button ng-click="save()"&gt;Save&lt;/button&gt;
              &lt;button ng-click="clear()"&gt;Clear&lt;/button&gt;
          &lt;/p&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>