The roles of AngularJS and Polymer

A key feature of AngularJS 2.0 is its support for Web Components [1]. Google’s Polymer is a Web Component polyfill (enabling them on all current browsers) and a framework on top of Web Components. This blog post describes how the Angular team sees the roles of AngularJS and Polymer.

The roles, according to the AngularJS team

AngularJS 2.0 team member Rob Eisenberg recently explained the relationship between AngularJS and Polymer:

  • “Angular is really designed around optimizing application development (including DI, routing, templating and decorator directives, more advanced databinding)”
  • “while Polymer is really optimized around custom element development. So, it has basic templating and binding and a strong component model.”

Therefore, Eisenberg expects people to implement cross-framework UI components either as pure Web Components or via Polymer. He thinks apps and app-specific components are more likely to be built in Angular.

Are Polymer and AngularJS competing? Yes and no

At Google I/O 2014, Google presented Paper Elements, custom elements following the new Material Design. These elements are Web Components, implemented via Polymer. They are very useful for Angular, especially version 2.0 and don’t compete with it. That is, Polymer as a Web Component polyfill and platform for widgets benefits Angular. However, Polymer as a framework does compete with it in some ways. It’ll be interesting to see how that plays out in the future.

Further reading

  1. Plans for supporting Web Components in AngularJS and Ember.js


Axel Rauschmayer said...

AngularJs is a Framework full completely, other "Frameworks" JS are basically Libraries.

Axel Rauschmayer said...

This personally grinds my gears. Obviously AngularJS and Polymer are overlapping. But noone can give a clear and direct answer, if Polymer at the current state, should be used to substitute to angularjs or as a complement.

I opened a stackoverflow question here:

But I don't get any clear answer from anyone. Only suggestions from other developers, trying to figure out themselves.

Axel Rauschmayer said...

I'm confused as to why people think this is a this-or-that battle. Polymer only really "competes" with Angular in the re-usable component section, which Angular refers to as 'directives'. Aside from that Polymer is WAY more under-powered for most other application functions, such as complex URL routing.


Angular - application development framework - build full sites/applications

Polymer - web component library - build re-usable "parts" for those sites using new web APIs