TypeScript Angular 2 Responses Subscribing
<p>I'm trying to return information from my api but I don't understand how to correctly use subscribe. With an array I return an empty array from my service and push values into it as I get them.</p>

<p>How would I correctly return just a single value variable in app-component ts. Right now If I do a <code>alert(JSON.stringify(authenticated))</code> it just gives me <code>{"_isUnsubscribed":false,"_subscriptions":[{"isUnsubscribed":false}]}</code></p>

<p>app-component ts</p>

<pre><code>checkAuthentication(){
  var authenticated = this._authService.getAuthenication();
}
</code></pre>

<p>authentication Service</p>

<pre><code> getAuthenication() {
      return this._http.get('auth.php').subscribe(res =&gt; {
        if (res.json().authenticated === true){
          return true;
        }
        return false;
      });
  }
</code></pre>

<p>auth.php</p>

<pre><code>&lt;?
session_start();
$authenticated = ( isset($_SESSION["authenticated"]) ? true : false );
$post_data = json_encode(array(authenticated =&gt; $authenticated));
echo $post_data;
?&gt;
</code></pre>