Week 8 | Property Keys

polymer 1.0
Mon Oct 17 2016

In the previous posts we went over various ways to declare an element. There is an object now, named properties where we can configure the properties of our element.

Any property that is part of our element’s public API should be part of the property’s object. Each property has a set of keys.

These are the type, value, reflectToAttribute, notify, computed and observer. The next couple of weeks we’ll go over each key.

myproperty:{
  type: "",
  value: "",
  refrechToAttribute:"",
  notify:"",
  computed:"",
  observer:""
}

 

<!DOCTYPE html>

<html>
  <head>
    <script src="https://polygit.org/components/webcomponentsjs/webcomponents-lite.min.js"></script>
    <link rel="import" href="https://polygit.org/components/polymer/polymer.html" />
  </head>
  <body>
    
  <alert-element></alert-element>
  <dom-module id="alert-element">
    <template></template>
  </dom-module>
  <script>
    HTMLImports.whenReady(function () {
      Polymer({
          is: "alert-element",
          properties:{
            
          }
      });
    });
  </script>
  </body>
</html>

 

Full Stack Weekly Newsletter

A free weekly newsletter for full stack web developers!