Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
考虑以下情况:
http://jsfiddle.net/dzpGY/1/
我将如何删除特定节点,而不是从父节点中删除子节点。的使用data.$parent似乎不起作用。
data.$parent
试试这个:http: //jsfiddle.net/dzpGY/
你很接近,$parent.data.nodes但是,你不能把它放进去,$scope.delete因为这个方法$scope会引用树的根$scope,而你想引用叶子的父级。
$parent.data.nodes
$scope.delete
$scope
controller您可以为每个叶子创建一个单独的ng-repeat并在那里放置一个delete()方法。
controller
ng-repeat
delete()
Following on from my questions in this StackOverflow thread, I'm trying to use an image as a link. The image is an