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 PeggemPosted Apr 27, 2017, 1:44 AM
Bharath PeggemPosted Apr 28, 2017, 1:32 AM
Posted Apr 27, 2017, 5:01 AM
Posted Apr 27, 2017, 4:40 AM