View crashes when processing data


#1

Hello friends,

When I’m doing a search on an API the application crashes, and when the process ends it back up and running normally. Does anyone know how to solve? I structure my controller like this:

app.controller('myController', function($scope){    
    $scope.data = null;    
   
    var init = function(){      
       loadData();   
   };

    var loadData = function(){                            
        $scope.data = callAPI("users/find").data;
    };

    init();
});

#2

could you show us the callAPI function?


#3

It is just a example


#4

yeah but your code shows nothing… structure of your controller looks good, I also do something similar in my controllers and have no problems.

so the interesting part is, what you are doing for sending the api-calls.