title: angularjs - toggle ng-class from multiple ng-clicks
body: <p>I've just started working on a project that requires me to learn AngularJS. What I'm trying to do is create two menus that slide into the screen, one from the left, one from the right. When they do this they push the content over.</p>
  
  <p>Currently I can get one or the other to work, but not both. I realize this is because of the way that I'm defining the ng-class. I just can't quite conceptualize how to do it correctly.</p>
  
  <pre><code>&lt;div ng-class="{true:'slide-left', false:''}[toggleSlide]" class="container"&gt;
  
      &lt;div class="content"&gt;
          &lt;button ng-click="toggleSlide = !toggleSlide" class="btn-left"&gt;From Left&lt;/button&gt;
          &lt;button ng-click="toggleSlide = !toggleSlide" class="btn-right"&gt;From Right&lt;/button&gt;
      &lt;/div&gt;
  
      &lt;div class="slide-from-left"&gt;
          &lt;p&gt;Here is information that slides from off screen left.&lt;/p&gt;
      &lt;/div&gt;
  
      &lt;div class="slide-from-right"&gt;
          &lt;p&gt;Here is information that slides from off screen right.&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>