Directory

← Back

apod-request

Simple Polymer 2.0 element for integrating with NASA's Astromony Picture of the Date API

Author

Rating

Popularity

<100

[ This description is mirrored from README.md at github.com/gthmb/apod-request on 2019-05-22 ]

Published on webcomponents.org

<apod-request>

Simple Polymer 2.0 element for integrating with NASA's Astromony Picture of the Date API

<!-- the tag -->
<apod-request id="myRequest" api-key="my-nasa-api-key"></apod-request>

<!-- example handling -->
<script>
  const request = document.querySelector('#myRequest'),
  results = document.querySelector("#results");

  request.addEventListener('data-changed', (evt) => {
    results.innerHTML = JSON.stringify(req.data, null, 2);
  });

  request.addEventListener('request-error', (evt) => {
    results.innerHTML = JSON.stringify(evt.detail, null, 2);
  });
</script>

Default usage

<apod-request api-key="my-nasa-api-key"></apod-request>
<!-- to listen for an event -->
<script>
    const request = document.querySelector('apod-request');
    request.addEventListener('data-changed', (data) => {
        console.log(data.detail.url);
        ...
    }
</script>

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Dependencies

Polymer/polymer#^2.0.0

Released
2017-09-11
Maturity
TESTED
License
Other

Compatibility

Framework
Polymer 2.0+
Browser
Browser Independent

apod-request - Vaadin Add-on Directory

Simple Polymer 2.0 element for integrating with NASA's Astromony Picture of the Date API apod-request - Vaadin Add-on Directory
**[ This description is mirrored from README.md at [github.com/gthmb/apod-request](https://github.com//gthmb/apod-request/blob/v0.0.7/README.md) on 2019-05-22 ]** [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg?style=flat-square)](https://www.webcomponents.org/element/gthmb/apod-request) # \ Simple Polymer 2.0 element for integrating with NASA's Astromony Picture of the Date API ```html ``` ## Default usage ```html ```
Online Demo
GitHub Homepage
Documentation
Issue tracker
License
View on GitHub

apod-request version 0.0.1
### Dependencies Polymer/polymer#^2.0.0

apod-request version 0.0.2
### Dependencies Polymer/polymer#^2.0.0

apod-request version 0.0.3
### Dependencies Polymer/polymer#^2.0.0

apod-request version 0.0.4
### Dependencies Polymer/polymer#^2.0.0

apod-request version 0.0.5
### Dependencies Polymer/polymer#^2.0.0

apod-request version 0.0.6
### Dependencies Polymer/polymer#^2.0.0

apod-request version 0.0.7
### Dependencies Polymer/polymer#^2.0.0

Online