mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
SkyElement
SkyElement is the framework for creating...yup...Sky Elements. It take heavy inspriation from Polymer and isn't very fully featured...yet
Declaring an element
<link rel="import" href="../path/to/sky-element.sky" as="SkyElement" />
<template>
<my-other-element>Hello, {{ place }}</my-other-element>
</template>
<script>
// SkyElement takes a single object as it's only parameter
SkyElement({
name: 'my-element', // required. The element's tag-name
attached: function() {
this.place = 'World';
}, // optional
detached: function() {}, // optional
attributeChanged: function(attrName, newValue, oldValue) {} // optional
});
</script>
Note that an element's declared ShadowDOM is the previous element to the