flutter_flutter/tests/resources/test-element.sky
Elliott Sprehn d3fbe58e94 Add shadowRootReady callback for SkyElement.
This is called right after stamping the template into the ShadowRoot.
This is a useful place to querySelector/getElementById for elements
inside the ShadowRoot.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/817053002
2014-12-19 14:01:49 -08:00

28 lines
699 B
Plaintext

<!--
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-->
<import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" />
<sky-element name="test-element">
<template>
<div id="inside" on-test-event="handleEvent" attr="{{ value }}">{{ value }}</div>
</template>
<script>
module.exports = class extends SkyElement {
created() {
this.lastEvent = null;
this.value = 10;
this.shadowRootReadyCount = 0;
}
handleEvent(event) {
this.lastEvent = event;
}
shadowRootReady() {
this.shadowRootReadyCount++;
}
}.register();
</script>
</sky-element>