1

function loadFollowing()
    {  
      if(typeof(EventSource)  !="undefined")
      {  
        var source=new EventSource("load_following_process.php");       
        source.onmessage=function(event)
        {
            $scope.$apply(function () {
                $scope.allFollowing =JSON.parse(event.data)
            });
          }
      }
    }
loadFollowing()

I tried to access $scope.allFollowing outside the function but it was giving me undefined. How can I access it outside the function

atomty
  • 187
  • 2
  • 16

0 Answers0