mirror of
https://github.com/jlengrand/web-components-workshop-polymer.git
synced 2026-03-10 08:51:20 +00:00
Step 1 : hello World
This commit is contained in:
17
index.html
Normal file
17
index.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script type="text/javascript" src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="/src/components/hello-world.html">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>WebComponents workshop</h1>
|
||||
<p>In this workshop, we will have some fun with Polymer</p>
|
||||
|
||||
<hello-world></hello-world>
|
||||
</body>
|
||||
</html>
|
||||
22
src/components/hello-world.html
Normal file
22
src/components/hello-world.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<link rel="import" href="/bower_components/polymer/polymer.html">
|
||||
|
||||
|
||||
<dom-module id="hello-world">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h2>Hello Meetup!</h2>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
class HelloWorldElement extends Polymer.Element {
|
||||
static get is() { return 'hello-world' }
|
||||
}
|
||||
customElements.define(HelloWorldElement.is, HelloWorldElement);
|
||||
</script>
|
||||
</dom-module>
|
||||
Reference in New Issue
Block a user