title: ng-show and/or ng-if do not function 100% of the time
body: <p>I have a Chrome extension uses an ng-show expression that checks a variable of Chrome storage, and displays a big blue button if the value is at zero. When opening the extension, however, the button could show up on the first click, or you may have to close and reopen the extension several times before it shows up (simply showing a blank body). This has been incredibly frustrating and is obviously a UX problem that I would like to fix before I publish the extension to the public.</p>
  
  <p>Here is the div code from within the main view of the extension:</p>
  
  <pre><code>&lt;div id="no_vseeks" ng-show="vseeks.length === 0"&gt;
      &lt;div class="big-button-container"&gt;&lt;a href="#!newVSeeks" class="big-button"&gt;&lt;h1&gt;CREATE&lt;/h1&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The expression is referring to an array called 'vseeks' in the Chrome local storage.</p>
  
  <p>And <a href="https://i.stack.imgur.com/CfXld.png" rel="nofollow noreferrer">here</a> is what the extension is supposed to output:</p>
  
  <p>But <a href="https://i.stack.imgur.com/3MsjL.png" rel="nofollow noreferrer">this</a> is what the extension will show (seemingly) at random.</p>
  
  <p>Please inform me if I need to include more code or images.</p>
  
  <p>EDIT: Here's the main controller where the vSeeks array is being retrieved from Chrome storage. The console logs show that after the chrome.storage.get function is called, the array is present, but yet I still get a blank view.</p>
  
  <pre><code>app.controller('mainController', function($scope, $window) {
  $scope.toggleAcc = function($event) {
      var currentAcc = $event.currentTarget;
      currentAcc.classList.toggle("active");
      var panel = currentAcc.nextElementSibling;
      if (panel.style.display === "block") {
          panel.style.display = "none";
      } else {
          panel.style.display = "block";
      }
  }
  $scope.sendID = function(id) {
      currentVID = id;
      $window.location.href = "#!delete";
  }
  var noVseeks;
  var home_button;
  var newV_button;
  
  console.log('controller reached', $scope.vseeks);
  chrome.storage.sync.get('userData', function(items){
      $scope.vseeks = items.userData.vSeeks;
      console.log('inside chrome storage get', $scope.vseeks);
      home_button = document.getElementById('home_button');
      newV_button = document.getElementById('newV_button');
      console.log('variables: ', home_button, newV_button);
      if ($scope.vseeks.length &lt; 1) {
          home_button.style.visibility = "hidden";
          newV_button.style.visibility = "hidden";
      }
      else {
          newV_button.style.visibility = "visible";
          if (home_button.style.visibility == "visible") {
              home_button.style.visibility = "hidden";
          }
      }
  });
  </code></pre>
  
  <p>});</p>