Guest User

Untitled

a guest
May 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #set($CLASS_NAME = "")
  2. #set($part = "")
  3. #if($NAME.endsWith(".js"))
  4. #set($end = $NAME.length() - 3)
  5. #set($NAME = "$NAME.substring(0,$end)")
  6. #end
  7. #foreach($part in $NAME.split("-"))
  8. #set($CLASS_NAME = "${CLASS_NAME}$part.substring(0,1).toUpperCase()$part.substring(1).toLowerCase()")
  9. #end
  10. import { PolymerElement, html } from '/node_modules/@polymer/polymer/polymer-element.js';
  11.  
  12. class ${CLASS_NAME} extends PolymerElement {
  13. static get template() {
  14. return html`
  15. <style>
  16. :host {
  17. display: block;
  18. }
  19. </style>
  20. <div>Hola mundo! Polymer 3</div>
  21. `;
  22. }
  23.  
  24. static get properties() {
  25. return {};
  26. }
  27.  
  28. }
  29.  
  30. window.customElements.define('${NAME}', ${CLASS_NAME});
Add Comment
Please, Sign In to add comment