title: Dynamically create polymer element
body: <p>I have defined login element as follows:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;polymer-element name="my-login" extends="form"&gt;
    &lt;template&gt; ...&lt;/template&gt;
  </code></pre>
  
  <p>and dart class as follows:</p>
  
  <pre class="lang-dart prettyprint-override"><code>@CustomTag('my-login')
    class MyLogin extends PolymerElement { .... }
  </code></pre>
  
  <p>In the main application component, I am trying to create my-login as follows:</p>
  
  <pre class="lang-dart prettyprint-override"><code> MyLogin p =  new Element.tag("my-login", "FormElement");
  </code></pre>
  
  <p>This generates exception:</p>
  
  <p>Exception: type 'HtmlElement' is not a subtype of type 'MyLogin' of 'p'.</p>
  
  <p>The code works if "extends=form" is removed from polymer-element declaration :</p>
  
  <pre class="lang-html prettyprint-override"><code> &lt;polymer-element name="my-login"&gt;
  </code></pre>
  
  <p>and created as follows:</p>
  
  <pre class="lang-dart prettyprint-override"><code>MyLogin p =  new Element.tag("my-login");
  </code></pre>
  
  <p>How to dynamically create custom element that extends other HTML element?</p>