Recently, I had problems binding data from the input element to the body-ajax body attribute. When I used core-ajax for polymer 0.5, I can easily bind these values:
<core-ajax id="ajax" method="POST" contentType="application/json" url="{{url}}" body='{"username":"{{username}}", "password":"{{password}}"}' handleAs="json" on-core-response="{{responseHandler}}"> </core-ajax>
Now I tried the same with iron-ajax. But it sends literally "{{username}}" and "{{password}}" instead of its values. Here is the code:
<iron-ajax id="ajax" method="POST" contentType="application/json" url="{{url}}" body='{"username":"{{username}}", "password":"{{password}}"}' handle-as="json" on-response="responseHandler"> </iron-ajax>
How to make it work? Thank you for your responses:)
javascript html ajax polymer
Achmad Giovani
source share