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

Golang & mgo: How to create a generic entity with common fields like _id, creation time, and last update
Unexpected error within json babel 6.9
ASP.Net MVC how to display linq query data to an string array in view [duplicate]
How to create custom key in json response using golang
Convert JSON to Avro schema in Nodejs
restify jsonClient failing at post
Kendo Grid Date Filter wont work with my JSON data
JSONArray parsing laravel 4
How to manipulate native Json in WSO2 ESB?
How to read html entities using json response in Symfony2
Razor if statement with JSON [duplicate]
jSon script not displaying the table content
How to make Flask parse numbers in POSTed JSON data?
Post nested Json to spring controller using Jackson data binding
Cannot connect to Twitter API from Postman
I need to validate that the start date is less than the end date in Yii2 with the help of JSON

Categories

HOME
makefile
tensorflow
app-inventor
ibm-watson-cognitive
dynamics-crm
jar
textwatcher
laravel-5.3
qpython3
command
parse-server
windows-store-apps
h2
structuremap
facebook-javascript-sdk
tee
x-frame-options
squarespace
mod-pagespeed
eclipse-luna
opera-mini
scenebuilder
tree-traversal
eclipselink
tortoisegit
shippo
url.action
thingsboard
onsen-ui
multiplayer
rworldmap
iis-10
red-black-tree
ioc-container
stocks
ifstream
qtablewidget
threshold
vsts-package-management
rhel.net
es-shell
haskell-pipes
silverlight-3.0
deepstream.io
restful-url
nsexception
sendgrid-templates
pytest-django
prototypejs
aqgridview
chunked-encoding
livefyre
web-deployment-project
workflow-foundation-4.5
cgcontext
nuget-server
paas
unity3d-editor
icefaces
galleriffic
aescryptoserviceprovider
wcf-ria-services
multiple-file-upload
shipitjs
ng2-material
multilingual-app-toolkit
concur
group-concat
web-essentials
hyperthreading
eyeql
application-loader
selendroid
built-in
risk-analysis
digits
google-hadoop
google-plus-one
adodb
jcr-sql2
belongs-to
gyroscope-framework
vcl
google-admin-audit-api
outline
csplit
android-looper
db4o
healthvault
surveyor-gem
phpsh
transitive-closure-table
dropdownlistfor
couchdb-lucene
wcf-web-api
selectonemenu
objectbrowser
text-size
scraperwiki
easygui
gtk2hs
authenticode
adsl
pureftpd
requestfactory
trampolines
oggvorbis
opcodes
document-library

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