title: Angular Compile Error: Type Subscription is Missing the Following Properties from Type Object[]: length, pop, push, concat
body: <p>I have been trying to figure out this for long time without any success.
  Would appreciate some help !
  I am using Angular Version 13,  &amp; trying to perform get request to get objects array from the database.
  I am getting the error: Type &quot;Subscription&quot; is missing the following properties from type 'Object[]': length, pop, push, concat, and 28 more.</p>
  <p>app.components.ts</p>
  <pre class="lang-js prettyprint-override"><code>    import { Component, OnInit } from '@angular/core';
      import { SEOService } from './services/shared/seo.service';
      import { StartupService } from './services/shared/startup.service';
      import { Object } from './services/shared/object';
      
      @Component({
        selector: 'app-root',
        templateUrl: './app.component.html',
        styleUrls: ['./app.component.scss']
      })
      
      export class AppComponent implements OnInit{
        siteUrl: string;
        pageObjects: Object[];
        pageConfig: any;
      
        constructor(private startupService: StartupService, private seoService: SEOService){
          this.siteUrl = '';
          this.pageObjects = [];
          this.pageConfig = {};
        };
      
        ngOnInit(){
          this.siteUrl = window.location.href;
          this.pageConfig = this.startupService.getPageConfig(this.siteUrl);    
          this.seoService.updateTitle(this.pageConfig.title);
          this.seoService.updateDescription(this.pageConfig.description);    
  
          this.pageObjects = this.startupService.getPageObjects(1).subscribe(
        (response: Object[]) =&gt; {
          this.pageObjects = response;
        },
        (error) =&gt; {
          console.log(error);
        }
      );
        };
      };
  </code></pre>
  <p>startup.service.ts</p>
  <pre class="lang-js prettyprint-override"><code>    import { Injectable } from '@angular/core';
      import { HttpClient } from '@angular/common/http';
      import { Observable } from 'rxjs';
      import { Object } from './object';
      
      @Injectable()
      
      export class StartupService {
        constructor(private httpClient: HttpClient){};
      
        getPageConfig(requestUrl: string): any[]{
          var pageConfig: any = {
            type: 'webproject',
            title: 'Yellow Pages &amp; Classifieds',
            description: 'Yellow Pages &amp; Classifieds'
          };
          return pageConfig;
        };
      
        getPageObjects(pageNID: number): Observable&lt;Object[]&gt;{
          return this.httpClient.get&lt;Object[]&gt;('http://localhost:1040/objects/getallbypage/' + pageNID);
        }
      };
  </code></pre>
  <p>object.ts</p>
  <pre class="lang-js prettyprint-override"><code>    export class Object {
          _id: string;
          nid: number;
          id: string;
          title: string;
          type: string;
          path: string;
          ofnid: number;
          of: string;
          loadpriority: number;
          isactive: boolean;
          pagenid: number;
          
          constructor(){
              this._id = '';
              this.nid = 0;
              this.id = '';
              this.title = '';
              this.type = '';
              this.path = '';
              this.ofnid = 0;
              this.of = '';
              this.loadpriority = 0;
              this.isactive = true;
              this.pagenid = 0;
          };
      };
  </code></pre>