Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70911

Ionic4 Angular7 Capacitor HttpCLient @angular/common/http

$
0
0

@cengiz74 wrote:

Hello everybody, I would really apreciate some help. I am using the HttpClient ( import {HttpClient} from ''@angular/common/http'; ). I can log data and error returned when subscribing to httpClient.get for instance if the project is launched on a browser. But when I launch my project for android on a Samsung galaxy s8 + no logs get returned. It looks like if subscription was ignored. I am using Angular7, Ionic4 and Capacitor, here is the sample code used:

import {HttpClient} from '@angular/common/http';

doTest() {
    console.log('Test'); // <-- Logging on both browser and Android
    this.httpClient.get('example.com').subscribe(
      data => console.log(data), // <-- Logging only in browser
      error => console.log(error), //  <-- Logging only in browser
    );
  }

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70911

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>