Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Polymer

Avatar for Jigarsolanki Jigarsolanki
September 12, 2014

 Polymer

Introduction to Ploymer

Avatar for Jigarsolanki

Jigarsolanki

September 12, 2014

Other Decks in Programming

Transcript

  1. Polymer Layer •  Sugaring layer on the top of web

    components Everything is an element Components all the way Write less code
  2. 1.  Install (github, bower, zip) bower install Polymer/core-input 2.  Include

    platform.js <script src="bower_components/platform/platform.js"></script> 3.  Import the element <link rel=“import” href=“bower_components/core-input/core-input.html”> 4.  Use the element <core-input></core-input> Use Existing Elements
  3. Awesome data-bindings!   •  Element it self is a model

    •  Two ways data-binding •  The <template> tag –  top-level element –  Render dynamic content •  Declarative event handling –  on-event syntax •  Changed watchers –  propertyNameChanged •  Expressions –  Custom filters –  Most of the operations are supported
  4. Life Cycle Methods   Polymer('tag-name', { created: function() { ...

    }, ready: function() { ... }, attached: function () { ... }, domReady: function() { ... }, detached: function() { ... }, attributeChanged: function(attrName, oldVal, newVal) { … }, });
  5. Communication & Message Passing   •  Data binding •  Changed

    Watcher •  Custom events •  Using element’s API
  6. Some Facts •  Current version: Alpha •  Plans to go

    beta –  Once at least browser starts supporting native features •  Although some companies already have started using it in production –  Github –  Sales force