The
Polymer defines a property that has a listening requirement as an accessor property (a property without listening requirements is still a normal attribute-form definition). In the template, you can also use the "::" syntax to synchronize an attribute bidirectional to an event in the target element, which is the concept of bidirectional binding in angular, even more pure and close to the principle.
properties defined in properties that do not have a notify and are not used in the template are not listening for requirements, so they are defined as normal properties. Otherwise, it will be defined as an accessor property, and the following example explains the problem
run
<script> var polymer = {dom: ' Shadow '}; </script>
<base href= "http://www.web-tinker.com/share/"/>
<link rel= "import" href= "polymer" /polymer.html "/>
<dom-module id=" Demo-test ">
<template>
A property with Notify True is set to produce a property name-changed"event when it is changed. Note that the attribute name and changed are linked with the crossbar, and the changed is the past tense, not the change prototype. Polymer can use listeners to add event sniffing, but not directly to a function, but must be bound to a property name (I don't understand why it is designed).
Run
<script> var polymer = {dom: ' Shadow '}; </script>
<base href= "http://www.web-tinker.com/share/"/>
<link rel= "import" href= "polymer" /polymer.html "/>
<dom-module id=" Demo-test ">
<template>
Events can be captured in the template using "::" > Falay, and these events include the notification event that is generated above and the interactive event that the user actively triggers.
Run
<script> var polymer = {dom: ' Shadow '}; </script>
<base href= "http://www.web-tinker.com/share/"/>
<link rel= "import" href= "polymer" /polymer.html "/
<dom-module id=" Demo-test ">
<template>
<input value=" {{text::input}} " />
Note that the above is style$= "[CSS]" instead of the direct style= "CSS", because this is the attribute assigned to the element, rather than the pure property assignment. So add a "$" in front of the equals sign (actually I think this syntax looks very strange).
These are all the things that I know about data binding in polymer. There may be omissions, which may be supplemented in other articles.