-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathx-pokemon.html
38 lines (37 loc) · 897 Bytes
/
x-pokemon.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!--
/**
* @module Pokemon Element
*/
/**
* x-pokemon allows users to insert Pokemon into pages.
*
* Example:
*
* <x-pokemon name="pikachu"></x-pokemon>
*
* @class x-pokemon
*/
-->
<link href="bower_components/polymer/polymer.html" rel="import">
<polymer-element name="x-pokemon" attributes="name">
<template>
<img class="pokemon" alt="{{name}}" src="http://img.pokemondb.net/artwork/{{name | toLowerCase}}.jpg">
</template>
<script>
Polymer('x-pokemon', {
/**
* Name of the pokemon to display.
*
* @attribute name
* @type string
* @default ''
*/
name: '',
toLowerCase: function(value) {
if (value) {
return value.toLowerCase();
}
}
});
</script>
</polymer-element>