$destroy can refer to 2 things: a method and an event
1. method is $ scope. $ destroy
.directive("colorTag", function(){ return { restrict: "A", scope: { value: "=colorTag" }, link: function (scope, element, attrs) { var colors = new App.Colors(); element.css("background-color", stringToColor(scope.value)); element.css("color", contrastColor(scope.value));
event - $ scope. $ on ("$ destroy")
See @SunnyShah answer .
niaher Sep 30 '15 at 18:04 2015-09-30 18:04
source share