title: Why is my data is not binding properly between components?
body: <p><code>maps.component.ts</code> sends <code>title</code>, <code>mapItems</code>, and <code>displayedColumns</code> to <code>summary.component.ts</code> to be displayed. </p>
  
  <p>The thing is that <code>title</code> and <code>displayedColumns</code> work correctly, but I'm not too sure why <code>mapItems</code> isn't working correctly, that it is not displayed.</p>
  
  <p>If I move <code>displayedColumns</code> and <code>mapItems</code> outside of the subscribe block, the table is then displayed properly (for both data), but inside the subscribe block only <code>displayed Columns</code> is properly passed. So I think something is happening here that I'm not very sure of. </p>
  
  <p>Note: I didn't receive any error messages in my console logs. </p>
  
  <p>Edit: I'm using ELEMENT_DATA as initial testing, eventually I want to pass the data from the get method instead.</p>
  
  <p>Final Edit: Answer solved, please look at my answer below. Problem was with dataSource. </p>
  
  <p>maps.component.ts</p>
  
  <pre class="lang-js prettyprint-override"><code>import { Component, OnInit, ViewChild } from '@angular/core';
  import {MatPaginator} from '@angular/material/paginator';
  import {MatTableDataSource} from '@angular/material/table';
  import { ConfigService } from '../services/config.service';
  
  
  export interface PeriodicElement {
    name: string;
    position: number;
    weight: number;
    symbol: string;
  }
  
  const ELEMENT_DATA: PeriodicElement[] = [
    {position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H'},
    {position: 2, name: 'Helium', weight: 4.0026, symbol: 'He'},
    {position: 3, name: 'Lithium', weight: 6.941, symbol: 'Li'},
    {position: 4, name: 'Beryllium', weight: 9.0122, symbol: 'Be'},
    {position: 5, name: 'Boron', weight: 10.811, symbol: 'B'},
    {position: 6, name: 'Carbon', weight: 12.0107, symbol: 'C'},
    {position: 7, name: 'Nitrogen', weight: 14.0067, symbol: 'N'},
    {position: 8, name: 'Oxygen', weight: 15.9994, symbol: 'O'},
    {position: 9, name: 'Fluorine', weight: 18.9984, symbol: 'F'},
    {position: 10, name: 'Neon', weight: 20.1797, symbol: 'Ne'},
  ];
  
  
  @Component({
    selector: 'app-maps',
    templateUrl: './maps.component.html',
    styleUrls: ['./maps.component.css']
  })
  export class MapsComponent implements OnInit {
  
    title = 'maps';
    mapData;
    mapItems: JSON[];
    error: Error;
    displayedColumns: string[]; 
  
    constructor(private configService: ConfigService) { }
  
    ngOnInit() {
      this.displayedColumns = [];
  
      this.configService.getMaps().subscribe((data) =&gt; {
  
        this.mapData = {
          assetID: "hello"
        };
  
        this.displayedColumns = ["position", "name", 'weight', 'hello'];
        this.mapItems = JSON.parse(JSON.stringify(ELEMENT_DATA));
  
      }, error =&gt; this.error);
  
    }
  
  }
  </code></pre>
  
  <p>maps.component.html</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;app-summary [title]="title" [items]="mapItems [displayedColumns]="displayedColumns"&gt;&lt;/app-summary&gt;
  </code></pre>
  
  <p>summary.component.ts</p>
  
  <pre class="lang-js prettyprint-override"><code>export class SummaryComponent implements OnInit {
    addLink: string;
    editLink: string;
    deleteLink: string;
  
    @Input() title: string;
    @Input() items: JSON[];
    @Input() dataSource: MatTableDataSource&lt;any&gt;;
    @Input() displayedColumns: string[]; 
  </code></pre>
  
  <p>summary.component.html</p>
  
  <pre class="lang-html prettyprint-override"><code>    &lt;div class="table-container"&gt;
          &lt;table mat-table [dataSource]="dataSource" class="mat-elevation-z8"&gt;
              &lt;div *ngFor="let col_name of displayedColumns"&gt;
                  &lt;ng-container matColumnDef={{col_name}}&gt;
                      &lt;th mat-header-cell *matHeaderCellDef&gt; {{col_name}} &lt;/th&gt;
                      &lt;td mat-cell *matCellDef="let item"&gt; {{item[col_name]}} &lt;/td&gt;
                  &lt;/ng-container&gt;
              &lt;/div&gt;
  
              &lt;tr mat-header-row *matHeaderRowDef="displayedColumns"&gt;&lt;/tr&gt;
              &lt;tr mat-row *matRowDef="let row; columns: displayedColumns;"&gt;&lt;/tr&gt;
          &lt;/table&gt;
          &lt;mat-paginator [pageSizeOptions]="[5, 10, 20]" showFirstLastButtons&gt;&lt;/mat-paginator&gt;
      &lt;/div&gt;
  </code></pre>