Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
expose more xhr features
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott J. Miles committed Aug 22, 2013
1 parent 55c4bc3 commit 3e7a2d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions polymer-ajax/polymer-ajax.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
-->
<link rel="import" href="polymer-xhr.html">

<polymer-element name="polymer-ajax" attributes="url handleAs auto params response">
<polymer-element name="polymer-ajax" attributes="url handleAs auto params response method">
<script>
Polymer('polymer-ajax', {
/**
Expand Down Expand Up @@ -90,6 +90,7 @@
* @default null
*/
response: null,
method: '',
created: function() {
this.xhr = document.createElement('polymer-xhr');
},
Expand Down Expand Up @@ -165,13 +166,14 @@
* @method go
*/
go: function() {
var args = {};
var args = this.xhrArgs || {};
args.params = this.params || null;
if (args.params && typeof(args.params) == 'string') {
args.params = JSON.parse(args.params);
}
args.callback = this.receive.bind(this);
args.url = this.url;
args.method = this.method;
return args.url && this.xhr.request(args);
}
});
Expand Down

0 comments on commit 3e7a2d5

Please sign in to comment.