0
votes

Does anyone of you know if it's possible to set the default value of the withCredentials Property of the Polymer iron-ajax element?

The default value is false, but i need it to be true (need it multiple times and i don't want to write with-credentials="true" every time)

2

2 Answers

0
votes

You can wrap the iron-ajax element inside a another element. In the new element expose all of the properties of the iron-ajax element.

That way you can set the property to true and when you need ajax just use the wrapped iron-ajax element.

0
votes

By default Polymer iron-ajax element with-credentials value is false. Use with-credentials to set it as true. Ex. <iron-ajax id="abc" method="post" handle-as="json" with-credentials>