title: Angularjs toggle div visibility
body: <p>I am trying to toggle a div text on click of a button. I tried taking a scope variable and toggeling classname based on the variable. Where am I making the mistake <a href="http://jsfiddle.net/nw5ndzrt/340/" rel="nofollow noreferrer">here</a></p>
  <pre class="lang-html prettyprint-override"><code>&lt;button ng-click=&quot;toggle()&quot;&gt;test&lt;/button&gt;
  &lt;div ng-class=&quot;{{state}}&quot;&gt;
    hello test
  &lt;/div&gt;
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>function ctrl($scope) {
    $scope.state = vis;
    $scope.toggle = function() {
      state = !state;
    };
  }
  </code></pre>
  <pre class="lang-css prettyprint-override"><code>.vis {
    display: none;
  }
  </code></pre>