সম্পাদনা
<!DOCTYPE html> <html ng-app="app"> <body> <div ng-controller="app"> <p>{{message}}</p> <button ng-click="remove()"></button> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.8.3/angular.min.js"></script> <script> angular.module("app", []) .controller("app", function($scope) { $scope.message = "স্কোপ সক্রিয় রয়েছে"; $scope.$on("$destroy", function() { console.log("Scope destroyed"); }); $scope.remove = function() { $scope.$destroy(); }; }); </script> </body> </html>
পূর্বরূপ