title: Convert Javascript object to JSON just one time in Angularjs
body: <p>I want to convert javascript object to <code>JSON</code> with <code>angular.toJson</code> just one time.
  my code is:</p>
  
  <pre><code>$scope.task.tags = [{"id":22,"tag":"printer","created_at":"2016-03-15" }];
  
  $scope.create = function(task) {
     tmp.tags = angular.toJson(task.tags);
     TaskService.create(tmp);
  });
  </code></pre>
  
  <p>and in html:</p>
  
  <pre><code>&lt;input type="text" ng-model="task.tags"&gt;
  &lt;button class="btn btn-success" ng-click="create(task)"&gt;save&lt;/button&gt;
  </code></pre>
  
  <p>but when click on the <code>button</code> more than one time, show me <code>{{task.tags}}</code> like this:</p>
  
  <p>1st result:</p>
  
  <pre><code>[{"id":22,"tag":"printer","created_at":"2016-03-15"}]
  </code></pre>
  
  <p>2nd result:</p>
  
  <pre><code>"[{\"id\":22,\"tag\":\"printer\",\"created_at\":\"2016-03-15\"}]"
  </code></pre>
  
  <p>3rd result:</p>
  
  <pre><code>[{\\\"id\\\":22,\\\"tag\\\":\\\"printer\\\",\\\"created_at\\\":\\\"2016-03-15 09:59:23\\\"}]\""
  </code></pre>