View crashes when processing data

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();
});

could you show us the callAPI function?

It is just a example

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.