web - Double Brackets [[ ]] vs Double Braces {{ }} in Polymer -
what's succinct way explain difference between double brackets ([[...]]
) , double braces ({{...}}
) in polymer 1.0?
for instance, in documentation <iron-list>
element sample html shows:
<template is="dom-bind"> <iron-ajax url="data.json" last-response="{{data}}" auto></iron-ajax> <iron-list items="[[data]]" as="item"> <template> <div> name: <span>[[item.name]]</span> </div> </template> </iron-list> </template>
why data
bounded double braces in 1 spot (last-response="{{data}}"
) bounded double brackets (items="[[data]]"
) in spot?
binding can either one-way (using [[]]) or two-way (using {{}}, use notify).
to explain *-way binding think traffic. one-way binding when update model, view gets updated. when vice-versa true two-way binding.
for more information see documentation.
Comments
Post a Comment