Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
4
Answers
loading different area in page by angular
tri_inn
7y
253
1
Reply
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'
);
});
}
});
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
validation in angular js
angular js service and factory