TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
tri_inn
NA
1.2k
233.5k
loading different area in page by angular
Apr 26 2017 10:54 AM
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'
);
});
}
});
Reply
Answers (
4
)
validation in angular js
angular js service and factory