title: Angular button to hide on load based on table row information
body: <p>I have a table that gets filled with information from the database. It also has a Submit button. If the person on that row respect a certain condition that I check in controller, the button shouldn't appear. How can I do this?</p>
  
  <p>I tried setting up a function that returns true or false but that function will run continuosly and crashes my program. I also tried setting up that function to run at some interval and again, it didn't change the button. The problem is I think that at the begining, when I load the page, the client can't take any information from the table, it always gets undefined.</p>
  
  <p>Code html:</p>
  
  <pre><code>    &lt;form&gt;
  &lt;table class="table table-hover"&gt;
      &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;Id&lt;/th&gt;
          &lt;th&gt;Status&lt;/th&gt;
          &lt;th&gt;Location&lt;/th&gt;
          &lt;th&gt;Start&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      &lt;tr data-ng-repeat="interview in $ctrl.pendingInterviews"&gt;
          &lt;td&gt;{{ interview.id }}&lt;/td&gt;
          &lt;td&gt;{{ interview.status }}&lt;/td&gt;
          &lt;td&gt;{{ interview.location }}&lt;/td&gt;
          &lt;td&gt;{{ interview.start | date:'medium' }}&lt;/td&gt;
          &lt;td&gt;&lt;input type="submit" name="Submit" id="submit" ng-hide="varDiv" ng-click="varDiv = true; $ctrl.addParticipant(interview.id)"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;&lt;/form&gt;
  </code></pre>
  
  <p>Right now it just dissapears after I click on it which is not ok because when I reload, it appears again.</p>
  
  <pre><code>this.checkIfAdded = function checkParticipant(interviewId) {
                      var participant={
                          username:"mama",
                          interviewId:interviewId
                      };
                      return Interview.checkIfAdded(JSON.stringify(participant))
                          .then(
                              function (errResponse) {
                                  console.error('Error while fetching pending interviews');
                              }
                          );
                  }
  </code></pre>
  
  <p>this will return true or false I think based on what it gets from Interview.checkIfAdded.</p>