11-24 899 views
<div id="add" data-id="2" data-name="Google" onclick="onClick(this)">Click Me</div>
在AngularJS中没用,把this传进去后你会发现你只是获取到了scope
<button id="test" class="button button-balanced pull-right" ng-click="test($event);" >test</button>
$scope.updateSelection = function($event, id){
var checkbox = $event.target;
var action = (checkbox.checked?'add':'remove');
updateSelected(action,id,checkbox.name);
}