Explanation
Contrary to your assumption stated in the question title, functions from your code will be called in a specified order:
$http.get
$scope.getChilds
However, the success and error callbacks for $http.get are asynchronous. That means that these functions will be called when the $http.get data is ready. I.e. this can take 1 millisecond or this can also take a whole minute (for example) – the success / error callbacks will be called when needed without stopping your main thread.
Solution
So the solution is to put the $scope.getChilds part in the success callback.
I suggest you to learn more about callbacks and promises to have a better understanding.
Side Note
Accroding to the AngularJS $http docs, success and error methods are deprecated, and you should use then instead:
The $http legacy promise methods success and error have been
deprecated and will be removed in v1.6.0. Use the standard then method
instead
$scope.DbDatain your success promise?$scope.DbData. So what you are trying to achieve while calling this unknown function$scope.getChilds()? If you want$scope.getChilds()executed after the request was successful just put it inside yoursuccessfunction.