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()
我试图在函数外部访问$scope.allFollowing
,但这给了我未定义的含义。如何在功能之外访问它