title: Confirm dialog box in angularjs
body: <p>How can I apply confirm dialog box in below button in angularjs ? </p>
  
  <pre><code>&lt;button class="btn btn-sm btn-danger" ng-click="removeUser($index)"&gt;Delete&lt;/button&gt;
  </code></pre>
  
  <p>Just like this.</p>
  
  <pre><code>&lt;span&gt;&lt;a class="button" onclick="return confirm('Are you sure to delete this record ?')" href="delete/{{ item.id }}"&gt;Delete&lt;/span&gt;
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>Currently I am doing it like this</p>
  
  <pre><code>    function removeUser(index) {
        var isConfirmed = confirm("Are you sure to delete this record ?");
        if(isConfirmed){
          vm.users.splice(index, 1);
        }else{
          return false;
        }
      };
  </code></pre>