您可以简单地创建一条指令,该指令添加一个函数,该函数将删除元素的html。然后,您可以将其粘贴在ng-
click上。我在这里做了一个小提琴:http :
//jsfiddle.net/qDhT9/
// in the directivescope.remove = function() { elt.html('');};// in the dom<div remove-on-click ng-click="remove()"> REMOVE ME </div>希望这对您有所帮助!



