App-location removes query string parameters
I have a very simple polymer 2 application that uses string query parameters. Moving to Polymer 2.0.1 and app-location 2.0 (instead of rc and previews), I noticed that simply having the app-location element removes all query string parameters from the URL.
Try this url: https://api-1913.s3-eu-west-1.amazonaws.com/index.html?foo=bar and notice how the query string is removed at load time.
Here's all the code: index.html:
<!DOCTYPE HTML>
<script src="/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<link rel="import" href="/my-app.html">
<html>
<head>
</head>
<body>
<my-app></my-app>
</body>
</html>
my-app.html:
<link rel="import" href="/bower_components/polymer/polymer.html">
<link rel="import" href="/bower_components/app-route/app-location.html">
<dom-module id="my-app">
<template>
<app-location></app-location>
<h1>Coin</h1>
</template>
<script>
class App extends Polymer.Element{
static get is(){return 'my-app'}
ready(){
super.ready()
console.log('ready')
}
}
customElements.define(App.is, App)
</script>
</dom-module>
Specifying an attribute query-params
to map it to a property App
does not change anything. Remove the item app-location
and the query string is preserved.
Has anyone seen this behavior? Is there a workaround - other than rolling back to a previous version?
source to share