What would be the best way if I have a firebase auth element using polymerfire, to use the user attribute globally?
For instance if I have an element with login buttons:
<dom-module id="tab-b">
<template>
<style>
</style>
<firebase-app auth-domain="example.firebaseapp.com"
database-url="example.firebaseio.com/"
api-key="">
</firebase-app>
<firebase-auth id="auth" location="{{location}}" user="{{user}}"provider="google" on-error="handleError">
</firebase-auth>
<paper-button id="googSignIn" class$="signInButton {{_getMiniClass()}}"on-tap="login" raised>
Google
</paper-button>
</template>
<script>
(function() {
'use strict';
Polymer({
is: 'tab-b',
properties:{
user: {
type: Object
},
statusKnown: {
type: Object
}
},
login: function(){
return this.$.auth.signInWithPopup();
},
logout: function(){
return this.$.auth.signOut();
}
});
})();
</script>
</dom-module>
And then I want to show or hide many components like this:
<element show$={{!user}}><element>