title: Change model property from view in Angular
body: <p>I am working in the mean stack, where I have an Article schema defined in Mongoose. One of the attributes is "approved" which I'm using to let admins approve a certain article from the admin dashboard.</p>
  
  <p>I'd like to modify the approved property using a button from the browser. I have the following code:</p>
  
  <p>Controller:</p>
  
  <pre><code>vm.approveArticle = function (id) {
      if (confirm("You are about to publish this article!")) {
          vm.articleData.approved = true;
      }
  };
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;td&gt;
    &lt;a href="#" class="btn btn-success disabled" ng-show="article.approved"&gt;Approved&lt;/a&gt;
    &lt;a href="#" class="btn btn-info" ng-click="article.approveArticle(art._id)" ng-show="!article.approved"&gt;Approve&lt;/a&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>Currently I'm getting a <code>TypeError: Cannot set property 'approved' of undefined</code> error, which proves I'm probably doing something wrong.</p>
  
  <p>How can I change the approved property from the view?</p>