Skip to content

Commit 6050465

Browse files
author
Zeno Rocha
committed
Updates
0 parents  commit 6050465

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

index.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>&lt;my-element&gt;</title>
6+
7+
<!-- Importing Web Component's Polyfill -->
8+
<script src="bower_components/platform/platform.js"></script>
9+
10+
<!-- Importing Custom Elements -->
11+
<link rel="import" href="src/my-element.html">
12+
</head>
13+
<body>
14+
15+
<!-- Using Custom Elements -->
16+
<my-element></my-element>
17+
18+
</body>
19+
</html>

src/my-element.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!-- Import Polymer -->
2+
<link rel="import" href="../bower_components/polymer/polymer.html">
3+
4+
<!-- Define your custom element -->
5+
<polymer-element name="my-element">
6+
7+
<script>
8+
Polymer('my-element', {
9+
// Fires when an instance of the element is created
10+
created: function() {},
11+
12+
// Fires when the "<polymer-element>" has been fully prepared
13+
ready: function() {},
14+
15+
// Fires when the element was inserted into the document
16+
attached: function() {},
17+
18+
// Fires when the element was removed from the document
19+
detached: function() {},
20+
21+
// Fires when an attribute was added, removed, or updated
22+
attributeChanged: function(attr, oldVal, newVal) {}
23+
});
24+
</script>
25+
26+
</polymer-element>

0 commit comments

Comments
 (0)