hashbang
mode in addition to the existing auto
, hash
, and pushstate
.<app-route path="/home" import="pages/bundled-templates.html" template="homepage"></app-route>
.async
flag to <app-route>
HTML imports. By default HTML imports block rendering of the page. The router waits for the link's load
event to fire before using the imported document so this will speed up rendering when navigating between routes.onUrlChange="reload|updateModel|noop"
attribute to <app-route>
. This is useful when you have nested routers and you only want to change the inner most route.previousRoute
) before it is removed from the DOM.route.importLink
reference.core-animated-pages
would remove the page after 5 seconds.**
support.users/:userId
which is the same as /**/users/:userId
.router.go('/path')
on the current path wouldn't reload the page.router.go('/path')
to fire a popstate
event instead of directly calling stateChange()
in order to support multiple routers on the same page.router.go('/path')
would replace state instead of push state.typecast="auto|string"
option on the app-router
. Path variables and query parameters are typecast to numbers, booleans, and unescaped strings by default. Now you can get the raw string with typecast="string"
.before-data-binding
event wasn't using the updated model if the entire model was replaced.http://example.com/#/page1#middle
will now scroll to an element with id="middle"
or name="middle"
.<template>
tags when Polymer (TemplateBinding.js
) is present.bindRouter
attribute to pass the router to the app-route
's page.before-data-binding
event to add properties to a model before it‘s bound to the route’s custom element or template.core-animated-pages
bug where multiple URLs matched the same app-route
(ex: path="/page/:num"
and paths /page/1
, /page/2
).platform.js
to webcomponents.js
removed the URL()
constructor polyfill. The v2.0.3 fix created a bug in Safari when parsing the URL. This fixes Safari.platform.js
to webcomponents.js
removed the URL()
constructor polyfill https://github.com/Polymer/webcomponentsjs/issues/53. IE doesn't support the URL()
constructor yet so this fix is adding URL parse support for IE.template.createInstance()
if Polymer is loaded, otherwise use document.importNode()
.<app-route>
s had an active
attribute.New features
<core-animated-pages>
. Example: set up the router like <app-router core-animated-pages transitions="hero-transition cross-fade">
then include the hero
and cross-fade
attributes on the elements you want transitioned.Breaking changes
<active-route>
element. Now the content for the route is under it’s <app-route>
element. This changed to support <core-animated-pages>
.<active-route>
element and router.activeRouteContent
have been removed.shadow
attribute from the <app-router>
. This was applied to the <active-route>
element which no longer exists.Breaking changes
pathType="auto|hash|regular"
has been replaced with mode="auto|hash|pushstate"
for redirects, router.go(path, options)
, and testing routes.New features
<app-route path="..." redirect="/other/path"></app-route>
.router.go(path, options)
. Example: document.querySelector('app-router').go('/home', {replace: true})
.go()
you should specify the mode with <app-router mode="pushstate|hash"></app-router>
. Leaving the mode as auto
(the default) will change the hash, even if you wanted it to change the real path with pushstate.parseUrl()
to use the native URL()
constructor and return additional information about the hash path.testRoute()
and routeArguments()
with additional information from parseUrl()
.AppRouter.util
.pathType="hash"
was set on the router.template
no longer required on inline template routes.app-route
s that are direct children of the router by replacing querySelector()
with firstElementChild
and iterating with nextSibling
.pathType
attribute to the router. The options are auto
, hash
, and regular
.