[Polymer] Introduction

install Polymer and explore creating our first custom element:

 bower install polymer

index.html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Polymer</title>
    <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
    <link rel="import" href="bower_components/polymer/polymer.html">
    <link rel="import" href="./hello-world.html">
</head>
<body>
<hello-world name="ZTW"></hello-world>
</body>
</html>
  • include webcomponents-list.js file
  • import polymer.html file
  • import our compoment hello-world.html file

hello-world.html:

<dom-module id="hello-world">
    <template>
        <input type="text" value="{{name::keyup}}"> <!-- {{}} two way data binding, ::bind to event -->
        <h1>Hello, [[name]]</h1> <!-- [[]] one way data binding -->
    </template>
    <script>
        Polymer({
            is: "hello-world"  // string match the tag
        })
    </script>
</dom-module>
时间: 2024-10-10 08:59:03

[Polymer] Introduction的相关文章

Spring AOP之Introduction(@DeclareParents)简介

Spring的文档上对Introduction这个概念和相关的注解@DeclareParents作了如下介绍: Introductions (known as inter-type declarations in AspectJ) enable an aspect to declare that advised objects implement a given interface, and to provide an implementation of that interface on be

Introduction and Basic concepts

1 Network Edge The device such as computers and mobiles connect to the Internet. So they are referred as end systems(who run the application programs) sitting at the edge of the Internet. And we use host and end system interchangeably, that is host=e

初识Polymer框架

什么是polymer? polymer由谷歌的Palm webOS团队打造,并在2013 Google I/O大会上推出,旨在实现Web Components,用最少的代码,解除框架间的限制的UI 框架. polymer的核心思想是"Everything is an element",一切皆组件. polymer 可以通过Twitter的包管理器bower,方便的进行组件(Elements)及包的依赖管理,不必自己从git上下载组件. polymer分层结构: 元素层(Elemets)

Introduction to Machine Learning

Chapter 1 Introduction 1.1 What Is Machine Learning? To solve a problem on a computer, we need an algorithm. An algorithm is a sequence of instructions that should be carried out to transform the input to output. For example, one can devise an algori

我的Polymer学习总结

Polymer简化了Web组件的创建声明,利用这一特性,以更少的代码更简单的方式构建复杂的交互式内容.我们就来一起学习Polymer吧. 注册元素 生命周期回调 属性监听 本地DOM模板 数据绑定 注册元素 注册新元素需要调用 Polymer({})方法,你必须要定一个名称,以便在浏览器中使用他, 名称必须是"xxx-xxx",就是一定要带个"-",并为标签名关联一个prototype原型,就是调用Polymer(),所传的{}元素对象! <link rel=

The basic introduction to MIX language and machine

reference: The MIX Computer, The MIX Introduction sets, The basic info storage unit in MIX computer is the byte, which stores positive values in the range of 0 to 63. In MIX, Byte only has 6 bytes, and the word Byte refer to MIX 6-byte. A MIX word is

PyQt5 Introduction and components

在开始写代码以前,对PyQt5整体大致了解一下还是有必要的.这方面的东西看看PyQt5官方给出的文档就好,下面就是我从文中截取的部分内容: Introduction PyQt5 is a set of Python bindings for v5 of the Qt application framework from The Qt Company. Qt is a set of C++ libraries and development tools that includes platform

polymer入门例子-已过时

这个教程挺不错!:http://blog.csdn.net/renfufei/article/details/37040883 过时了,现在的版本已经为1.0了 一:创建APP结构 本教程会使用预先构建好的polymer元素:toolbar,tabs,panel <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=ye

[stm32参考手册] 1、Introduction

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xxand STM32F107xx advanced ARM-based 32-bit MCUs 本资料覆盖范围: 这本资料提供完整的关于上述系列STM单片机的存储器和外设的使用方法.在整个文档中(除非特别说明)是把这几类单片机归于STM32F10XXX系列的. 注:STM32F10XXX是一个包含的各种不同存储器尺寸,不同封装和不同外设的微处理器家族. 其他相关资料引导: 关于订货编号.电气和物理性