json


using flatmap to make nested service call with parameter


I am making a service call returning data from json file with a bunch of items but after get all the items i need to make another service call to get the contents of each of the items. I am using a flatmap but i am having some trouble on how to pass in a parameter - when i try it becomes underlined in the code as an error.
This is my data call:
getItems(){
this.itemService.getItemsData().flatMap(
data => {this.items = data;
error => this.errorMessage = <any>error;
return this.itemService.getItemContent();
}).subscribe(data => {
this.itemContent = data;
});
}
when i try passing into...getItemContent(this.items.contentUri) it gives me an error.
getItemsData(){
return this._http.get(url)
.map((res:Response) => res.json())
.map((obj) => Object.keys(obj).map((key)=>{return obj[key]}))
.catch(this.handleError);
}
getItemContent(uri){
return this._http.get(uri)
.map((res:Response) => res.json())
.catch(this.handleError);
}
How should i properly do this so when i get items i could also make a call to get the items contents based on a parameter?
here is a sample of the json structure:
{
Item 1: {
title:....
id:....
content:{
uri:"link"
}
}
}

Related Links

Access an ODBC connection via an API
how to index json to elasticsearch using hadoop map-reduce and es-hadoop?
History and XHR issues with Sails running on localhost
Parsing JSON in Dart
R on JSON, nested triks
HighCharts - Filling a heatmap from SQL Query
What should I do next when I got the return data of Alamofire?
Multiple filters for Safari content blocking Swift
How to get and access JSON data from ajax in django view?
angular, loop object array in a select and show two values
Update the data in datatable instead of reload whole page in codeigneator
Getting values from twitch.tv JSON response
Best way to use spring for Web and mobile application
Liferay: Issue when Using JSON WebService and https
moodle: how to change webservice message from xml to json
Elastic search: negative boost for term query

Categories

HOME
dotnetrdf
ibm-watson-cognitive
redis
project-management
oauth
filterrific
textwatcher
fparsec
reportportal
apollo
propertygrid
xtext
jpanel
spring-cloud-contract
aruco
criteria
oclint
camera-calibration
automata
sendkeys
netezza
zoomcharts
ada
primes
attask
cython
distance
deb
onsen-ui
piwik
version-numbering
pentaho-report-designer
partial-application
websauna
lmdb
piecewise
outsystems
m2e
modelandview
web-audio-api
threshold
honeysql
vsts-package-management
zero
image-compression
wcf-security
floating-accuracy
dart-pub
tripwire
distributed-transactions
google-account
pdftk
rich-text-editor
apiary
facebook-chatbot
dwarf
tcserver
forerunnerdb
volume
quintus
restivejs
gulp-typescript
rsqlite
inject
spark-cassandra-connector
post-processing
spservices
web-essentials
coldfusion-7
app.xaml
abas
manjaro
leadtools-sdk
lines-of-code
web-component-tester
alphablending
cloudpebble
candidate-key
dmp
ghostdoc
mov
sthttprequest
db4o
surveyor-gem
magickwand
zend-framework-modules
bulbs
git-filter-branch
n-layer
tfs-power-tools
cosm
visual-web-gui
jquery-selectbox
v4l
datacontract
qtembedded
paintcomponent
getresource
external-assemblies
openvg
integer-promotion
visual-studio-2010-beta-2
outlook-form

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App