title: Popup window in AngularJS
body: <p>I have a controller containing this code:</p>
  
  <pre><code>$scope.showSomething = false;
      $scope.doSomething = function () {
          $scope.showSomething = !$scope.showSomething;
  };
  </code></pre>
  
  <p>And in html I have this:</p>
  
  <pre><code>&lt;div class="row js-static-height-hook"&gt;
      &lt;div class="col-md-3 col-sm-3 col-xs-6" ng-repeat="interval in consumptionData.keys"&gt;
          &lt;div ng-if="consumptionData[interval]" ng-click="doSomething()"&gt;
                  &lt;modal title="Login form" visible="showSomething"&gt;
                          &lt;form role="form"&gt;
                            &lt;div class="form-group"&gt;
                              &lt;label for="email"&gt;Email address&lt;/label&gt;
                              &lt;input type="email" class="form-control" id="email" placeholder="Enter email" /&gt;
                            &lt;/div&gt;
                            &lt;div class="form-group"&gt;
                              &lt;label for="password"&gt;Password&lt;/label&gt;
                              &lt;input type="password" class="form-control" id="password" placeholder="Password" /&gt;
                            &lt;/div&gt;
                            &lt;button type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
                          &lt;/form&gt;
                        &lt;/modal&gt;
              &lt;div class="building-full__consumption-values oed-box-hover-effect"&gt;
                  &lt;span class="building-full__data-interval"&gt;{{consumptionData[interval].label}}&lt;/span&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>There are created some "buttons", as many as <code>ng-repeat</code> gets. My aim is to add functionality to them using <code>ng-click</code>.</p>
  
  <p>I'm trying to make the <code>modal</code> appear when a button is clicked and disappear when it is clicked outside of it. </p>
  
  <p>Now it appears on the screen all the time, no matter what I click.Do you know what should I change? Thanks.</p>