-
Notifications
You must be signed in to change notification settings - Fork 0
/
movies-app.html
43 lines (35 loc) · 1.15 KB
/
movies-app.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
39
40
41
42
43
<link rel="import" href="input-search.html">
<link rel="import" href="ajax-call.html">
<dom-module id="movies-app">
<template>
<style>
:host {
display: block;
padding: 5px;
}
</style>
<slot></slot>
<input-search placeholder="Escribe para empezar a buscar" value="Inception" button-name="Buscar" reg-exp="(^[A-Za-z0-9][ \S]*)"></input-search>
<ajax-call query-search="{{query}}"></ajax-call>
</template>
<script>
class MoviesApp extends Polymer.Element {
static get is() {
return "movies-app";
}
static get properties() {
return {
query: String
}
}
ready() {
super.ready();
const childElement = this.shadowRoot.querySelector('input-search');
childElement.addEventListener('button-clicked', (event) => {
this.query = event.detail.value;
});
}
}
customElements.define(MoviesApp.is, MoviesApp);
</script>
</dom-module>