A button that asks for confirmation before performing an action
See the element page: https://idanen.github.com/paper-confirm-button
- Import the element
<link rel="import" href="bower_components/paper-confirm-button/paper-confirm-button.html"/>
- Use the
<paper-confirm-button></paper-confirm-button>
in your page and add an action to be done once user confirms:
<paper-confirm-button id="confirm">Action!</paper-confirm-button>
<script>
let confirm = document.querySelector('#confirm'),
action = ev => console.log('confirmed!');
confirm.addEventListener('action-confirmed', action);
confirm.addEventListener('action-canceled', ev => console.log('Canceled by user'));
</script>
First, make sure you have the Polymer CLI installed. Then run polymer serve
to serve your application locally.
$ polymer serve
$ polymer build
This will create a build/
folder with bundled/
and unbundled/
sub-folders
containing a bundled (Vulcanized) and unbundled builds, both run through HTML,
CSS, and JS optimizers.
You can serve the built versions by giving polymer serve
a folder to serve
from:
$ polymer serve build/bundled
$ polymer test
Your application is already set up to be tested via web-component-tester. Run polymer test
to run your application's test suite locally.