title: ionic2: API response data undefined?
body: <p>I'm using <code>ionic2</code>, I want to make login request to api server, but I have response => <code>undefined</code> 
  this is the code in provider:</p>
  
  <pre><code>loginUser(email, password, macId, token) {
     let userObject = {
         "email": email,
         "password": password,
         "mac" : macId,
         "token" : token
     }
      var headers = new Headers();
      headers.append('Content-Type', 'application/json');
      headers.append('Access-Control-Allow-Origin', '*');
      console.log('object: ',userObject);
      return this.http.post(this.loginUrl, userObject, {headers:headers})
      .map((response: Response) =&gt; response.json())    
    }
  </code></pre>
  
  <p>and this is the code in <code>login page</code>:</p>
  
  <pre><code>loginUser(email,password) {
  console.log('email: ',email,'password: ',password);
  if(!this.loginForm.valid){
   this.submitAttempt = true;
  } else {
   this.submitAttempt = false;
   this.deviceInfo.macId = this.device.uuid;
   this.fcm.getToken().then(token=&gt;{
     this.token = token;
     });
   this.userProvider.loginUser(email,password,this.deviceInfo.macId,this.token)
   .subscribe(data=&gt; {
     alert("data is "+data);
   },
     (err)=&gt;{
       alert("err"+err);
     }
   )
  
  
  }
  </code></pre>
  
  <p>the output should be:</p>
  
  <pre><code>{
    msg : "SyGgTmNHxJcZFYJu6RootUHAqzdkhPNzsTGJHipeBZQSN8nHdbHga4gQ3jENesNPsK5tdtGKlmUa5g3cIVDO4ZqqENd5uPizwgWkq6z3CyUXAhyns8PTnNPwax7lgKRiY7I67qmiPCpZdwu2Kh5v7U"
  }
  </code></pre>
  
  <p>but the actual output: </p>
  
  <pre><code>data: "undefined"
  </code></pre>
  
  <p>what should I do?</p>