Polymer interview questions

Top Frequently Asked Polymer Interview Questions

What is Polymer.js ?

It is an open source JavaScript library. It is developed by Google. It is used to develop web applications for using of web components like HTML.

When was Polymer.js released ?

It was released on May 27, 2015 and 1.7.0 is stable release that was done on September 29, 2017

What are the features of Polymer.js ?

  • Simplest way to create custom HTML elements because this library is built on top of web standards API.
  • Has computed properties
  • Creation of hybrid mobile application is easy.
  • Provides gesture events
  • It distributes custom elements across network that can be used by users.
  • It provides the polyfills by this we can create our own customized elements.
  • It has both one way and two way data binding.
  • provides command line interface that helps to manage the project from simple to complicated application.
  • Provides cross browser compatible application.

What are the ways to install Polymer.js ?

  • Polymer Command Line Interface
  • Bower

What is the installation command for Polymer.js ?

npm install -g polymer-cli

How to check installed version of Polymer.js ?

polymer --version

How to initialize Polymer.js project ?

polymer init

What is the command to create universal build for Polymer.js ?

polymer build --js-compile

Mention Polymer.js elements ?

  • app elements : its used when building entire application.
  • iron elements : Basic building blocks for creating application.
  • paper elements : Used to implement Google's material design guidelines.
  • gold elements : Used to implement e-commerce-specific use cases.
  • neon elements : Used to implement animated transitions for Polymer elements.
  • molecules elements : Used to connect a group of plugins to the Polymer application.
  • google web components : Google's API and Service collection.

How to create custom element in Polymer.js ?

class MyCustomElement extends HTMLElement { 
   // code
};

//link the new class with an our element name
window.customElements.define('myCustomElement', MyCustomElement);

What is the custom element lifecycle in Polymer.js ?

  • constructor : When element is created
  • connectedCallback : When element is added to document
  • disconnectedCallback : When element is removed from document
  • attributeChangedCallback : When element is append, removed, changed or replaced from a document.

What are the imports used to define Polymer elements ?

  • polymer-element.html
  • legacy-element.html
  • polymer.html

What is Shadow DOM in Polymer.js ?

Its a property of DOM used to building components

What is event retargeting in Polymer.js ?

It specifies the event's target in which the element can be represented in the same scope as the listening element.

Give one example for shadow DOM styling ?

We can style the shadow DOM using the style properties.

<style>
   .mydemo { background-color: grey; }
</style>

<my-element>
#shadow-root
   <style>
      //this div will have blue background color
      div { background-color: orange; }
   </style>
   <div class = "mydemo">Demo</div>

What are the ways to define DOM templates ?

  • Create a <dom-module> element, which should match an element's name along with an id attribute.
  • Define a <template> element inside the <dom-module>

What is the Events in Polymer.js ?

it is used by elements to communicate state change of DOM to parent elements.

What is Gestures Events ?

Its used for user interaction that provides better interaction for touch and mobile devices.

How Polymer observes changes on an element's properties in Polymer.js ?

It does it by taking following actions.

  • Observers : It invokes the callbacks whenever the data changes.
  • Computed Properties : It computes the virtual properties based on other properties, and re-computes them whenever the input data changes.
  • Data Bindings : It updates the properties, attributes, or the text content of a DOM node using annotations whenever the data changes.

What is the use of Data binding in Polymer.js ?

its is used to connect the property and attributes of an element from the host element in its local DOM.

Mention helper element that are used for data binding use cases

  • Template Repeater
  • Array Selector
  • Conditional Template
  • Auto-binding Template



Visit Others Links

Interview Questions Top Elasticsearch Interview Question
Top Kubernetes Interview Question
Top HTTP Interview Question
Top PouchDB Interview Question
Top Pivotal Cloud Foundry (pcf) Interview Question
Top Apache Camel Interview Question
Top Docker Interview Question
Top Gradle Interview Question
Top Generics Interview Questions In Java
Java 9 Interview Questions
Top Maven Interview Question
Top RabbitMQ Interview Question
Top Spring Batch Interview Question
Top Spring Boot Interview Question
Top Tika Interview Question
Top Kotlin Interview Question
Top OpenShift Interview Question
Top Polymer Interview Question
Top WebGL Interview Question
Top Continuous Integration Interview Question
Top Spring Cloud Interview Question
Top JOGL Interview Question
Top JFreeChart Interview Question
Java MultiThreading Interview Question
Top Spring ROO Interview Question
Top Seaborn Interview Question
Top TestRail Interview Question
Top LolCode Interview Question
Top Spring Transaction Management Interview Question
Top DynamoDB Interview Question
Top PySpark Interview Question
Top SaltStack Interview Question
Top Spring AOP Interview Question
© 2019 PreparationForInterview.com