title: angularjs: confirmation dialog not working properly
body: <p>i am trying to create a confirmation dialog in angularjs, i found an answered question about that in stackoverflow 
  <a href="https://stackoverflow.com/questions/18313576/confirmation-dialog-on-ng-click-angularjs">Confirmation dialog on ng-click - AngularJS</a>
  i tried it as it is answered but when i click cancel it works as if i clicked OK is the answer wrong or should i add something else</p>
  
  <pre><code>    &lt;button type="button"  ng-click="updateData()" ng-confirm-click="Are you sure?"&gt;
              Update
      &lt;/button&gt;
  </code></pre>
  
  <p>directive</p>
  
  <pre><code>    app.directive('ngConfirmClick', [
      function(){
          return {
              link: function (scope, element, attr) {
                  var msg = attr.ngConfirmClick || "Are you sure?";
                  var clickAction = attr.confirmedClick;
                  element.bind('click',function (event) {
                      if ( window.confirm(msg) ) {
                          scope.$eval(clickAction)
                      }
                  });
              }
          };
  }])
  </code></pre>