I am using iron-pages and app-router to send me to a new page, where I need an iron-ajax element to send a request with the parameter sent from the router.
However, when I try to add my parameter {{parameter.identifier}} in iron ajax it does not work.
I suspect it has something to do with the routing parameters being local and that iron-ajax does not see it? I have tried to add a property for the param, and a getter function but nothing seems to be working...
Furthermore, I know the ajax is correct since if I change the binding variable {{parameter.identifier}} to a value that exists in the database it queries alright.
<dom-module id="cst-data">
<template>
<style>
</style>
<triplat-route name="dataRoute" params="{{parameters}}"></triplat-route>
<iron-ajax
id="getData"
auto
url="http:/.../oslc/os/OSLCPERSON?"
params='{"oslc.where":"dcterms:identifier={{parameters.identifier}}"
}'
headers='{"Content-Type": "application/json;charset=utf-8"'
handle-as="json"
on-response="handleResponse"
></iron-ajax>
<paper-card>{{parameters.identifier}}</paper-card>
<paper-card>{{dataRes.name}}</paper-card>
</template>
</dom-module>
<script>
Polymer({
is: "cst-data" ,
handleResponse: function () {
this.dataRes = this.$.getData.lastResponse['rdfs:member'];
}
});
</script>