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
Prakash
NA
258
77.9k
Http service
Mar 10 2016 7:09 AM
hello Experts,
Below code is executed.There are two Http methods call on two different conditions..i want one http call for these two urls.
please help thank you.
Services.factory('DashboardService', function($http) {
return {
getDashboardData: function() {
var isWebBrowser = ionic.Platform.is('browser');
var isAndroid = ionic.Platform.isAndroid();
var isIOS = ionic.Platform.isIOS();
var url = "/api";
var data ="id=23&mobile=true&user_id=21&user_mongo_id=533aa5d1d2f72";
var url_final = url + '/dashboard/?' + data;
console.log('DashboardService Service Called')
if(isWebBrowser == true){
return $http({
method: 'GET',
url: url_final,
params: {id:23, user_id:21, user_mongo_id:'533aa5d1d2f72', mobile: 'true'}
}).then(function(response) {
return response;
})
}
if(isWebBrowser == true || isIOS == true ){
return $http({
method: 'GET',
url:"http://site.in/dashboard",
params: {id:23, user_id:21, user_mongo_id:'533aa5d1d2f72', mobile: 'true'}
}).then(function(response) {
return response;
})
}
}
}
})
Reply
Answers (
1
)
jquery to loop in row and get column value in array
I want autocomplete in angularjs with categorized search