https://github.com/polymerelements/iron-ajax
Easily make ajax requests
https://github.com/polymerelements/iron-ajax
Last synced: about 1 year ago
JSON representation
Easily make ajax requests
- Host: GitHub
- URL: https://github.com/polymerelements/iron-ajax
- Owner: PolymerElements
- Created: 2015-04-16T16:47:01.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-10-16T14:02:56.000Z (over 2 years ago)
- Last Synced: 2025-05-16T01:06:24.899Z (about 1 year ago)
- Language: HTML
- Homepage: https://www.webcomponents.org/element/PolymerElements/iron-ajax
- Size: 620 KB
- Stars: 126
- Watchers: 19
- Forks: 113
- Open Issues: 59
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/@polymer/iron-ajax)
[](https://travis-ci.org/PolymerElements/iron-ajax)
[](https://webcomponents.org/element/@polymer/iron-ajax)
## <iron-ajax>
The `iron-ajax` element declaratively exposes network request functionality to
Polymer's data-binding system.
See: [Documentation](https://www.webcomponents.org/element/@polymer/iron-ajax),
[Demo](https://www.webcomponents.org/element/@polymer/iron-ajax/demo/demo/index.html).
## Usage
### Installation
```
npm install --save @polymer/iron-ajax
```
### In an html file
```html
import '@polymer/iron-ajax/iron-ajax.js';
```
### In a Polymer 3 element
```js
import {PolymerElement, html} from '@polymer/polymer';
import '@polymer/iron-ajax/iron-ajax.js';
class SampleElement extends PolymerElement {
static get template() {
return html`
`;
}
}
customElements.define('sample-element', SampleElement);
```
## Contributing
If you want to send a PR to this element, here are
the instructions for running the tests and demo locally:
### Installation
```sh
git clone https://github.com/PolymerElements/iron-ajax
cd iron-ajax
npm install
npm install -g polymer-cli
```
### Running the demo locally
```sh
polymer serve --npm
open http://127.0.0.1:/demo/
```
### Running the tests
```sh
polymer test --npm
```