title: Ngshow/hide based on ajax return value
body: <p>Does anyone know of a way to dynamically use ngshow to show/hide content based on an ajax return value?</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>$scope.loggedShow = false;
  
  var user = '';
  
  $scope.login = function(username, password) {
  
    $http({
      url: 'ajax/login.php',
      method: 'POST',
      data: {
        'username': username,
        'password': password
      }
  
    }).success(function(data, status, headers, config) {
  
      console.log(data);
      console.log('working');
  
      user = 'logged';
  
  
      if (user == 'logged') {
  
        $scope.loggedShow = true;
  
      } else {
  
        $scope.loggedShow = false;
  
      }
  
      getBanners();
  
    }).error(function(data, status, headers, config) {
      console.log('womp womp');
    });
  
  
  };
  </code></pre>
  
  <p>And here's the html:</p>
  
  <pre><code>&lt;div class="widget-header header-color-blue"  ng-show="loggedShow" &gt;
      &lt;div class="row"&gt;
          &lt;div class="col-sm-6"&gt;
              &lt;h4 class="bigger lighter"&gt;
                  &lt;i class="glyphicon glyphicon-align-justify"&gt;&lt;/i&gt;&amp;nbsp;
                  BANNERS
              &lt;/h4&gt;
          &lt;/div&gt;
  
          &lt;div class="col-sm-3"&gt;
              &lt;button restrict access="admin" ng-click="addNewClicked=!addNewClicked;" 
                      class="btn btn-sm btn-danger header-elements-margin"&gt;
                  &lt;i class="glyphicon  glyphicon-plus"&gt;&lt;/i&gt;&amp;nbsp;
                  NEW PROJECT
              &lt;/button&gt;
          &lt;/div&gt;
  
          &lt;div class="col-sm-3"&gt;
              &lt;input type="text" ng-model="filterBanners" 
                     class="form-control search header-elements-margin" 
                     placeholder="FILTER BANNERS"&gt;
          &lt;/div&gt;
      &lt;/div&gt;      
  &lt;/div&gt;
  </code></pre>
  
  <p>Basically, I set the value in the controller to false, then when the return value comes in, I validate it and set it to true, which should show the element.  Unfortunately, this isn't working as intended.  It processes the original statements fine (it properly hides the element), but on return of the value the scope doesn't update.  Is this how angular works?  Should I be using a directive instead?  </p>