Google Polymer! Nice!

2014-07-09_213551

took 12 minutes to learn (Really Lovely!)
and 30 seconds to figure out that:
– its faster then ExtJS.
– better approach thn AngularJS (I can Shadow-DOM biAAAtch)

Polymer layers..
Ksn6s

hands-on time?
-YES!
-just for clarification, here is my implementation of new element,
both in AngularJS and Polymer.

creating a nice rendering-directive
2014-07-09_221815

which will be translated into:
<imgsrc="https://www.gravatar.com/avatar/4879031fc142c87da9fde565fb4ea8fe.png">

as you know (or not..) every user in gravatar.com has a globally accepted image (mostly formatted mime-type of image/png..) that is the MD5 of its email.. Polymer Does MD5!!

Polymer uses “polyfills”
<polymer-elementname="user-gravatar" attributes="email">
<template>
<imgsrc="https://secure.gravatar.com/avatar/{{gid}}"/>
</template>
<script>
Polymer('user-gravatar', {
ready: function() {
this.gid = md5(this.email);
}
});
</script>
</polymer>

AngularJS approach is different..
app.directive('user-gravatar', ['md5', function() {
return {
restrict: 'E',
link: function(scope, element, attrs) {
scope.gid = md5(attrs.email);
},
template: '<imgsrc="https://gravatar.com/avatar/{{gid}}"/>'
};
});

its high level API, directive instead of shadow-DOM, which means, well nothing really to lamers..

 

Angular and Ember, Polymer is behind you, and its for dev.s like me who like building things bottom/up instead of using higher-(lamer)-API.

Leave a Reply