With the Polymer starter kit, i'm trying to trigger a route change from JS but can't get it working properly. Although the route changes, after i go back and forward again in the browser, the route doesn't get triggered anymore (page.js can't read read lenght), is this the correct way to change a route?
(function() {
Polymer({
is: 'my-greeting',
properties: {
greeting: {
type: String,
value: 'Enter username',
notify: true
},
pass:{
type:String,
value: '***',
notify: true
}
},
buttonClicked : function(){
this.doLogin();
},
doLogin : function(){
console.log(this.greeting);
app.myFirebaseRef.authWithPassword({
"email": this.greeting,
"password": this.pass
}, function(error, authData) {
if (error) {
console.log("Login Failed!", error);
} else {
// THIS IS IT
app.route = 'users';
history.pushState({customurl:'users'}, null, 'users');
}
});
}
});
})();