The Polymer project consists of:
Web Component Tester - the tool for unit testing apps built with Polymer. You get a browser-based testing environment, configured out of the box with mocha, chai, async, lodash, sinon & sinon-chai, test-fixture, accessibility-developer-tools. WCT will run your tests against whatever browsers you have installed locally, or remotely via Sauce Labs.
on-myListener
listener will be set on mylistener
event.listen
you can also use unlisten
method remove any listener.property-changed
e.g if property is myProperty
event will be my-propert-changed
(camel casing to '-'). You can listen to them either by using on-event
attribute of listener
Object.e.detail.value
for property change events.A good example of this will be form, where submit button should only be active if all the mandatory fields have input.
In this example, the library used in the component is installed with the package manager bower. This allows for easy distribution of a library-dependent component. If the library you wish to use is not distributed via a package manager, it can still be loaded the same way but your component will be require more effort to be used by others.
The lazy loading example uses a simple string for the library path. If one wished to avoid magic string constants, paths could be loaded using iron-ajax from a JSON file into an object and passed between components if needed.
Note:
The code through this writeup, is not a working copy. You need to replace the fillers for hrefs,src’s and project names.
The code illustrates only a Proof of concept.
To see the custom element in action,
And, to browse through the usage and structure of the custom element,
The Usage is in “index.html”
The element is in, “elements/tool-bar.html“
For the entire code, Navigate to the Repository
To see the google map in action, Look Here