In my Polymer app, I want to read a JSON file, for this I use an element. Part of the url is send by the parent element of the element currently using this . My String is properly recovered, i tried to just display it and it return exactly what I want. The problem is that if I just put the String in my url path like this :
<iron-ajax auto url="questions/{{path}}.json" handle-as="json" last-response="{{questions}}"></iron-ajax>
It doesn't work, I read on other threads that the cause of this is the use of a dynamic String which can't be used in the url path, as the String is data-binded.
If I wrote the url manually it works just fine :
<iron-ajax auto url="questions/listQuestions.json" handle-as="json" last-response="{{questions}}"></iron-ajax>
So I tried to compute my value to just return a String but it doesn't work either. It's has been hours of trying to come up with a solutions and research one on Internet but it just doesn't work.
Here's my code with the computed properties I tried :
properties: {
path :String,
url: {
type: String,
notify: true,
computed: 'computeurl(path)'
}
},
_acces: function(path) {
return "questions/"+path+".json";
},
computeurl: function(path) {
return path;
}
When I tried to display them like this :
<p><span>[[_acces(path)]] or [[url]] or [[path]]</span></p>
I got :