angular js中的确认删除 (confirming delete in angular)

访问量: 713

// in controller
function FooController($scope)
{
  $scope.removeUser = function() {
     var deleteUser = confirm('Are you absolutely sure you want to delete?');   
    if (deleteUser) {
      alert('Going to delete the user');
    }
  }
}

HTML:

<a class="delete button" href="#" ng-click="removeUser(user, $event)" >Delete</a>

订阅/RSS Feed

Subscribe

分类/category