opened
justinfagnani
username_0
Nodes inside a template (`template.content`) need to be imported into the main document in order for them to be upgraded. See an example of importing a `<template>`s content here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template

`ViewFactory._createView` instead imports the `<template>` element itself, not its content. Since `<template>` has no custom element registry and its contents are inert, its content nodes are not upgraded and remain un-upgraded when appended into the document.

`ViewFactory` clones the template here:

https://github.com/angular/angular/blob/f830cfca12d7b90c44a4a9bbe8884b0dafb8b00a/modules/angular2/src/render/dom/view/view_factory.js#L65

then access the content here:

https://github.com/angular/angular/blob/f830cfca12d7b90c44a4a9bbe8884b0dafb8b00a/modules/angular2/src/render/dom/view/view_factory.js#L80

it should clone the content first, then just iterate over the clone later.
<template> tag and importNode() are used incorrectly, breaks custom element upgrading
issue
closed
mhevery
username_1
issue
created
mhevery
username_1
resolved https://github.com/angular/angular/pull/1970
comment