erikringsmuth / app-router

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

full page load not working #11

Closed ghost closed 10 years ago

ghost commented 10 years ago
  1. added a menu link to scaffold template <a active?="{{selected == 'SubPage'}}" href="/pages/subpage/index.html">
  2. make a page there that is dead simple copy of the API page

Everything loads in the network console with nothing missed, but its gets a " Platform is not defined " from polymer.js

???

erikringsmuth commented 10 years ago

That'd be the platform polyfill.

http://www.polymer-project.org/docs/start/platform.html https://github.com/Polymer/platform

This is polyfill used by both Polymer and X-Tag to get Custom Elements, HTML Imports, <template>, and Shadow DOM working in browsers that don't support Web Components natively. Now that Chrome officially supports Web Components I'm hoping they'll fix Polymer to not have a hard dependency on this. For now you'll need the polyfill though.

This is how I included it in gh-pages. https://github.com/erikringsmuth/app-router/blob/gh-pages/index.html#L8

ghost commented 10 years ago

i tried that first and it did not work for sub pages.

erikringsmuth commented 10 years ago

I wonder if it has something to do with relative paths to platform.js. You could try it like this everywhere. <script src="/bower_components/platform/platform.js"></script>

ghost commented 10 years ago

that was the first thing i tried

does not work for some reason.

still trying to work out what is happening

Contact details: +49 15 23 18 94 553 (germany) skype: gedw99

On 1 August 2014 16:20, Erik Ringsmuth notifications@github.com wrote:

I wonder if it has something to do with relative paths to platform.js. You could try it like this everywhere.

— Reply to this email directly or view it on GitHub https://github.com/erikringsmuth/app-router/issues/11#issuecomment-50889524 .

ghost commented 10 years ago

i get

Uncaught SyntaxError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'subpage'. The type name is invalid.

Contact details: +49 15 23 18 94 553 (germany) skype: gedw99

On 1 August 2014 16:27, Ged Wed gedw99@gmail.com wrote:

that was the first thing i tried

does not work for some reason.

still trying to work out what is happening

Contact details: +49 15 23 18 94 553 (germany) skype: gedw99

On 1 August 2014 16:20, Erik Ringsmuth notifications@github.com wrote:

I wonder if it has something to do with relative paths to platform.js. You could try it like this everywhere.

— Reply to this email directly or view it on GitHub https://github.com/erikringsmuth/app-router/issues/11#issuecomment-50889524 .

erikringsmuth commented 10 years ago

registerElement requires a dash in the name. Switching subpage to sub-page might help.

erikringsmuth commented 10 years ago

I think this issue is resolved. I added a full page load example here. https://github.com/erikringsmuth/app-router-examples