Nicolas S.Xu Nicolas S.Xu - 10 months ago 73
AngularJS Question

What is ondelete in angularjs directive definition?

I am reading this article and then encountered the ondelete concept in directive, which I couldn't find the explanation in official document.

app.directive('stickyNote', function(socket) {
var linker = function(scope, element, attrs) {};
var controller = function($scope) {};
return {
restrict: 'A',
link: linker,
controller: controller,
scope: {
note: '=',
ondelete: '&' // What is ondelete? Where is document?

Can you please help me find the official document to explain ondelete in directive?


Scope has a $destroy event. You may subscribe on it

$scope.$on('$destroy', function() {...});