title: HttpErrorResponse in Ionic Angular
body: <p>I'm trying to work with Ionic (first attempt) and somehow I'm not able to get my data in my view</p>
  
  <h3>Code</h3>
  
  <p><code>Service (posts.service.ts)</code></p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  import { Observable } from 'rxjs';
  import { map } from 'rxjs/operators';
  
  
  @Injectable({
    providedIn: 'root'
  })
  export class PostsService {
  
    apiUrl = 'https://example.com/api/posts/';
    url: any;
  
    constructor(private http: HttpClient) { }
  
    getPosts(): Observable&lt;any&gt; {
      return this.http.get(`${this.apiUrl}`).pipe(
        map(posts =&gt; posts)
      );
    }
  
    getDetails(url) {
      return this.http.get(`${this.url}?i=${url}&amp;plot=full`);
    }
  }
  </code></pre>
  
  <p><code>Controller (posts.page.ts)</code></p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { Observable } from 'rxjs';
  import { PostsService } from './../../services/posts.service';
  
  @Component({
    selector: 'app-posts',
    templateUrl: './posts.page.html',
    styleUrls: ['./posts.page.scss'],
  })
  export class PostsPage implements OnInit {
  
    posts: Observable&lt;any&gt;;
  
    constructor(private postsService: PostsService) {}
  
    ngOnInit() {
    }
  
  }
  </code></pre>
  
  <p><code>view (posts.page.html)</code></p>
  
  <pre><code>&lt;ion-list&gt;
    &lt;ion-item *ngFor="let post of posts"&gt;
      &lt;div slot="start"&gt;&lt;/div&gt;
      &lt;img [src]="post.image" /&gt;
      {{post.title}}
      &lt;div class="item-note" slot="end"&gt;
        {{post.body}}
      &lt;/div&gt;
    &lt;/ion-item&gt;
  &lt;/ion-list&gt;
  </code></pre>
  
  <h3>Output</h3>
  
  <p><code>Live API</code></p>
  
  <p><a href="https://i.stack.imgur.com/tvJu0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tvJu0.png" alt="one"></a></p>
  
  <p><code>My APP</code></p>
  
  <p><a href="https://i.stack.imgur.com/cYQj4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cYQj4.png" alt="two"></a></p>
  
  <p>Any idea where I did mistake?</p>