演示:http://jsfiddle.net/sunnycpp/u4vjR/2/
在这里,我创建了 handle-destroy 指令。
ctrl.directive('handleDestroy', function() { return function(scope, tElement, attributes) { scope.$on('$destroy', function() { alert("In destroy of:" + scope.todo.text); }); };});


