javascript - scope variable change after refresh -


in parent view request json file , put in $scope.data. in child view can access without problem , $scope.data.length gives me correct number of items.in console can see json file , start directly [resource { name="alex...
if refresh page, or try access child view directly, $scope.data.length return '0' still can see json file in $scope.data. it's strange, in console don't see before anymore, looks different enter image description here

console.log($scope.data.length); console.log($scope.data);

    for(var i=0; i<$scope.data.length; i++)     {        if($scope.data[i].id) == $scope.id)         {         selected=$scope.data[i];         console.log("id found: "+ $scope.id);           }     } 

if refresh page, scope.lenght return 0 in both cases can see json file


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -