Angular JS Tricks

Home / Coding Tricks / Angular JS Tricks

Use Controller $scope from outside Angular JS

$scope = angular.element(document.getElementById('yourControllerElementID')).scope();
    
$scope.$apply(function () {
      
  // Do you stuff here
      
});

Leave a Reply

Your email address will not be published. Required fields are marked *