Web 開發元件化有其優勢與應用場景。PolymerJS 是 Google 打造支援 Web Compoent 標準的實作框架,雖然 AngularJS 有 directive 來提供元件開發與應用,但這點如果和 PolymerJS 比起來,PolymerJS 其實更為全面且出色。
今年 Google 2014 開發者大會推出 Material Design 後,PolymerJS 率先支援了 Material Design 元件組,筆者小小玩一下感覺很 high 啊
9. 很明顯,Polymer 幹的是苦差事 (看很遠)
"X-Tag and Polymer are both
high-level sugar libraries that
build upon the W3 Web
Components specs - each
introduces a different approach
to making development of web
components an even more
amazing experience. To help
make this more relatable,
consider the following:
jQuery : DOM
X-Tag/Polymer : WebComponents.
"
22. 實戰#2 - template + data-binding
● HTML5 new Tag - <template>
● Object.observe() - Polymer data-binding
23. <template>
template (n) - A document or file having a preset format, used as a starting
point for a particular application so that the format does not have to be
recreated each time it is used.
26. 感受一下 paper 元件和雙向綁定
Link
Dynamic,
two-way data binding
Note: The <template> element is a new
element in the HTML standard. For
information on using templates outside of
Polymer, see HTML’s New Template Tag on
HTML5Rocks.
Link
28. 人臉追蹤、聲音播放/辨識
trackingjs.js
voices Web Component wrapper to the Web
Speech API, that allows you to do voice
recognition and speech synthesis using
Polymer