$scope.$watch(function() {
return $http.pendingRequests.length;
}, function(newVal) {
if (newVal === 0) {
(function loadScript(src) {
var scriptElement = document.createElement('script');
scriptElement.src = src;
window.document.head.appendChild(scriptElement);
})("/path/to/script/");
}
});