suppose when first time web site load then i need to load left and top menu.
both menu will load independently and so anyone may load and show first.
so tell me the trick which i need to apply to show both left and top menu at same time if top or left menu load first. some how i need to show both the menu at same time.
tell me what code i need to change in below. below code is just a sample code and not tested.
- app.service("TopMenuService", function ($http) {
- this.getTopMenu = function () {
- debugger;
- return $http.get("/employee/getTopMenu");
- };
- });
- app.service("LeftMenuService", function ($http) {
- this.getLeftMenu = function () {
- debugger;
- return $http.get("/employee/getLeftMenu");
- };
- });
- app.controller("EmpCtrl", function ($scope, TopMenuService,LeftMenuService) {
- GetTopMenu();
- GetLeftMenu();
- function GetTopMenu() {
- debugger;
- var _getTopMenu = EmployeeService.getTopMenu();
- _getTopMenu.then(function (topmenu) {
- $scope.topmenu = topmenu.data;
- }, function () {
- alert('Data not found');
- });
- }
- function GetLeftMenu() {
- debugger;
- var _getLeftMenu = EmployeeService.getLeftMenu();
- _getLeftMenu.then(function (leftmenu) {
- $scope.leftmenu = leftmenu.data;
- }, function () {
- alert('Data not found');
- });
- }
- });
Bharath PeggemRank #3,303 · 435 reputationPosted Apr 26, 2017, 9:44 PM EDT
Posted Apr 27, 2017, 12:40 AM EDT
Posted Apr 27, 2017, 1:01 AM EDT
Bharath PeggemRank #3,303 · 435 reputationPosted Apr 27, 2017, 9:32 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts