title: Angular 7: Property 'data' does not exist on type 'Object'
body: <p>I am using angular7 and following the step as  the exact example here
  <a href="https://coursetro.com/posts/code/171/Angular-7-Tutorial---Learn-Angular-7-by-Example" rel="nofollow noreferrer">https://coursetro.com/posts/code/171/Angular-7-Tutorial---Learn-Angular-7-by-Example</a></p>
  
  <p>But getting the error data doesn't. Here is the error below:</p>
  
  <pre><code>src/app/home/home.component.html:18:29 - error TS2339: Property 'data' does not exist on type 'Object'.
  
  18     &lt;li *ngFor="let user of users.data"&gt;
                                 ~~~~~~~~~~
  
    src/app/home/home.component.ts:6:16
      6   templateUrl: './home.component.html',
                       ~~~~~~~~~~~~~~~~~~~~~~~
      Error occurs in the template of component HomeComponent.
  </code></pre>
  
  <p>I am trying to test the code and generate the service but i keep getting  errors in home.component.html
  home.component.ts</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { DataService } from '../data.service';
  
  @Component({
    selector: 'app-home',
    templateUrl: './home.component.html',
    styleUrls: ['./home.component.scss']
  })
  export class HomeComponent implements OnInit {
  
    users: Object;
  
    constructor(private data: DataService) { }
  
    ngOnInit() {
      this.data.getUsers().subscribe(data =&gt; {
        this.users = data
        console.log(this.users)
      })
    }
  
  }
  </code></pre>
  
  <p>home.component.html</p>
  
  <pre><code>&lt;ul *ngIf="users"&gt;
      &lt;li *ngFor="let user of users.data"&gt; 
        &lt;!-- &lt;img [src]="user.avatar"&gt;
        &lt;p&gt;{{ user.first_name }} {{ user.last_name }}&lt;/p&gt; --&gt;
        &lt;p&gt; {{user}}&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  </code></pre>
  
  <p>data.service.ts</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  
  @Injectable({
    providedIn: 'root'
  })
  export class DataService {
  
    constructor(private http:HttpClient) { }
    getUsers() {
      return this.http.get('https://reqres.in/api/users');
    }
  
  }
  </code></pre>
  
  <p>this is the exact code as the example..how can this be resolved?</p>