title: How to fetch records from Json Placeholder, store it in an array and print on screen
body: <p>I'm using Json placeholder. I want to learn how to fetch records from remote server and use it. Here is my code:</p>
  <pre><code>import { Component, OnInit } from '@angular/core';
  
  @Component({
    selector: 'app-photographs',
    templateUrl: './photographs.component.html',
    styleUrls: ['./photographs.component.css']
  })
  export class PhotographsComponent implements OnInit {
  
    myStringifiedJson;
  
    constructor() {
      console.log(this.myStringifiedJson[&quot;title&quot;]);
    }
  
    ngOnInit() {
      fetch('https://jsonplaceholder.typicode.com/photos')
      .then(response =&gt; response.json())
      .then(json =&gt; this.myStringifiedJson=JSON.parse(json));
    }
  }
  </code></pre>
  <p>I'm getting this error:</p>
  <blockquote>
  <p>ERROR TypeError: this.myStringifiedJson is undefined</p>
  </blockquote>
  <p>Here is the <a href="https://stackblitz.com/edit/angular-ivy-vxjfqk" rel="nofollow noreferrer">stackblitz</a>.
  Please correct me. Do I have to use <code>stringify</code> here ?</p>