erikringsmuth / app-router

Router for Web Components
https://erikringsmuth.github.io/app-router/
MIT License
610 stars 83 forks source link

Support app-route definitions inside content tags #97

Closed bruce closed 4 years ago

bruce commented 9 years ago

Resolves #96.

This PR adds support for pulling in app-route elements via the content tag, collecting them from the ancestor shadow root's host (if any). This supports composition of routers using Polymer, notably.

A working functional test is provided.

Note that the method of determining the shadow root ancestor (toString) is taken from http://stackoverflow.com/questions/27453617/how-can-i-tell-if-an-element-is-in-a-shadow-dom (due to issues with iframes). It's possible this could also be done with nodeType or checking instanceof if that is not a concern.

panuhorsmalahti commented 8 years ago

Somewhat related to this: https://github.com/erikringsmuth/app-router/pull/143

bruce commented 4 years ago

Closing as stale.