Creating an In-project Web Component
Use Polymer CLI to create a new Polymer element in the in your project
You can find extensive Polymer CLI installation instructions at https://www.polymer-project.org/2.0/docs/tools/polymer-cli
In short you need to install: 1. Node / npm 2. Git 3. Bower 4. Polymer-cli
sh
You can find extensive instructions on how to create a Polymer element at
Assuming you name your Polymer element my-test-element
(the name MUST contain at least one dash), the element needs to end up in .
To get the files in the correct place you can do
sh
This works exactly as described in Creating Java API for a Web Component. The only difference is that static files are loaded from your project instead of from a webjar and you can modify them easily while creating the Java API.
As an example, for the generated my-test-element
, you could do
Java
You can now use the component as e.g.
Java