How to get currently logged in auth state/user from angularfire2
<p>I have an ionic2 app and am using Firebase and angularFire2.  I'd like to get the current authentication state and current auth object/user from firebase using angularFire2.</p>

<p>Here's what's working so far - I can authenticate the user and subscribe to the FirebaseAuthState to get the facebook user object. </p>

<pre><code>  constructor(platform: Platform, private auth: FirebaseAuth) {

    auth.subscribe((user: FirebaseAuthState) =&gt; {
      if (user) {
        // I could store user in localstorage, but I'd like to see an All Firebase solution
        this.rootPage = TabsPage;
      } else {
        this.rootPage = LoginPage;
      }
    });
</code></pre>

<p>Now I can just set localstorage here and cache my user object to remember auth state.  However, I am curious to see how I can use Firebase only without me implementing my own custom local storage key.  I see that Firebase stores a localStorage key of it's own so knows that its logged in.</p>

<p>How can I get the auth object from code?  Additionally, I tried the listed example in the AngularFire2 documentation to render the auth state in the template - but that gives me an error.</p>

<pre><code>import {FirebaseAuth} from 'angularfire2';
@Component({
  selector: 'auth-status',
  template: `
    &lt;div *ng-if="auth | async"&gt;You are logged in&lt;/div&gt;
    &lt;div *ng-if="!(auth | async)"&gt;Please log in&lt;/div&gt;
  `
})
class App {
  constructor (@Inject(FirebaseAuth) public auth: FirebaseAuth) {}
}
</code></pre>