Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

a generator for make the static directives to build the polymer elements with angular2-cli.

Notifications You must be signed in to change notification settings

hydraslay/ng2-polymer-static-gen

Repository files navigation

ng2-polymer-static-gen

This project is a generator for make the static directives to build the polymer elements with angular2-cli.

There is already some elements that have been generated here you can use.

Quick start

  1. Install all dependencies.

npm install

bower install

  1. Check src/index.html and bower.json if there is already including the polymer element you want. If not, add them just like the way you use in your app.
  • in src/index.html: <link rel="import" href="assets/bower_components/paper-input/paper-input.html">
  • in bower.json, run: bower install --save paper-input
  1. Run the server

ng serve

  1. See "http://localhost:4200/" , input the name of the element and press button "Generate Code".
  • If the include is not correct, there may be a error message looks like The Polymer element "xxxx" has not been registered....
  1. Copy the code to save a file named "xxxxx.directives.ts", just like the first line suggested.
  2. Include the directive file to your module.ts.

import { PaperInput } from './polymer/paper-input-directives';

and add the directive as declarations: [ ... PaperInput, ...

see the whole sample project of how to use static directives

About

a generator for make the static directives to build the polymer elements with angular2-cli.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published