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
ahmed elbarbary
NA
1.6k
278.4k
error when create service res.json is not a function
Dec 30 2019 1:55 AM
I work on angular 7
I create service take array of locations then make forjoin between them
but i get error as following :
error when create service res.json is not a function
core.js:15724 ERROR TypeError: res.json is not a function
at MapSubscriber.project (part-details.service.ts:56)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/map.js.MapSubscriber._next (map.js:35)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/map.js.MapSubscriber._next (map.js:41)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
at FilterSubscriber.push../node_modules/rxjs/_esm5/internal/operators/filter.js.FilterSubscriber._next (filter.js:38)
at FilterSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber.notifyNext (mergeMap.js:84)
at InnerSubscriber.push../node_modules/rxjs/_esm5/internal/InnerSubscriber.js.InnerSubscriber._next (InnerSubscriber.js:15)
at InnerSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
and this is my code
getLocationData(ids: Array<number>) {
let observableBatch = [];
ids.forEach((id) => {
observableBatch.push(
this
.http.get(
'http://192.168.7.45:9200/location/_doc/'
+id)
.map((res: any) => res.json()));
});
return
Observable.forkJoin(observableBatch);
}
//--------------------------------
}
error show display here
How to solve this problem please ?
I pass array of locationid to url to get gps1
from json returned from function then i mkae forkjoin between them
Reply
Answers (
1
)
How to replace red shap on google map with circle googlemap
error Cannot read property ‘split’ of undefined