$http.get('/services/menu').success(function (dataMenu) {
$http.get('/services/language').success(function (dataLanguage) {
console.log('dataLanguage', dataLanguage);
$scope.menuRoot = dataMenu.result.items;
$scope.menuItems = dataMenu.result.items;
$scope.languageRoot = dataLanguage.result;
$scope.currentMenuItem = null;
$scope.refreshExperiments();
$scope.mergeLanguage();
});
});
Yes, you can run them in parallel by using $q.all
:
$q.all([$http.get('/services/menu'), $http.get('/services/language')])
.then(function (res) {
var dataMenu = res[0].data.result.items;
console.log('dataLanguage', res[1].data);
$scope.menuRoot = dataMenu;
$scope.menuItems = dataMenu;
$scope.languageRoot = res[1].data.result;
$scope.currentMenuItem = null;
$scope.refreshExperiments();
$scope.mergeLanguage();
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With