Skip to content

Latest commit

 

History

History
116 lines (95 loc) · 3.11 KB

README.md

File metadata and controls

116 lines (95 loc) · 3.11 KB

Form-Fire

form-fire

A form that syncs data to Firebase.


<form-fire>

You can sync data to a form by syncing directly with a document using method= set. This is the default method.

<firebase-app
  name="demo"
  api-key="AIzaSyAhoCXxkY-ffNwA_7L7HIwBVpASYj1btNE"
  auth-domain="convoo-login-demo.firebaseapp.com"
  database-url="https://convoo-login-demo.firebaseio.com">
</firebase-app>
<form-fire path="/test" app-name="demo" method="set">
    First name: <input type="text" name="fname"><br>
    Last name: <input type="text" name="lname"><br>
    <input type="submit" value="Save">
</form-fire>

You can also push to a list at a specific Firebase path instead of setting. Do this by setting a value of "push" to method.

<firebase-app
  name="demo"
  api-key="AIzaSyAhoCXxkY-ffNwA_7L7HIwBVpASYj1btNE"
  auth-domain="convoo-login-demo.firebaseapp.com"
  database-url="https://convoo-login-demo.firebaseio.com">
</firebase-app>
<form-fire path="/test" app-name="demo" method="push">
    First name: <input type="text" name="fname"><br>
    Last name: <input type="text" name="lname"><br>
    <input type="submit" value="Save">
</form-fire>

Install the Polymer-CLI

First, make sure you have the Polymer CLI installed. Then run polymer serve to serve your application locally.

Viewing Your Application

$ polymer serve

Building Your Application

$ 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

Running Tests

$ 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.