Nicolas S.Xu Nicolas S.Xu - 1 year ago 116
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?

Answer Source

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

$scope.$on('$destroy', function() {...});
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download