title: Angular @Input of type string-array recognized as string
body: <p>I have an Angular CLI component that contains an array of strings &quot;searchResult&quot;:</p>
  <pre><code>export class ParentComponent implements OnInit {
  
    mockArray: string[] = [];
    searchString: string = '';
    searchResult: string[] = [];
  
    constructor(private service: SomeService) {
    }
  
    ngOnInit(): void {
      this.mockArray = this.service.getArray();
    }
  
    onKeyDown() {
      if (this.searchString.length &gt; 2) {
        this.searchResult = this.mockArray.filter(symptom =&gt;
          symptom.includes(this.searchString)
        )
      }
    }
  }
  </code></pre>
  <p>In this component, I re-assign the result of the filter method executed on another string-array to the searchResult.
  In its html template, I want to pass it down to a child component:</p>
  <pre><code>&lt;child-component searchResult=&quot;{{searchResult}}&quot;&gt;&lt;/child-component&gt;
  </code></pre>
  <p>And in the child component, I receive the variable via an @Input() declaration:</p>
  <pre><code>export class ChildComponent {
  
    @Input() searchResult: string[] = [];
  
  }
  </code></pre>
  <p>However, on ng serve, I receive an error regarding the line in the html template of the parent componment:</p>
  <pre><code>error TS2322: Type 'string' is not assignable to type 'string[]'
  </code></pre>
  <p>I receive this error despite both variable being an array of strings and not just a string.</p>
  <p>Edit: I just found out, for some reason the filter method returns a string of all the items passing the condition, instead of an array of these items. However, the original array &quot;mockarray&quot; that I call filter() on looks like this:</p>
  <pre><code>  [
      'elevated midi-chlorian count',
      'low self-esteem',
      'urge to flip a table',
      'headache',
      'sore feet',
      'loss of smell',
      'hearing voices',
      'pain in sole of the feet',
      'breathlessness',
      'shortness of breath',
      'difficulty breathing',
      'respiratory distress',
      'pain in knee',
      'stiff finger joints',
      'back pain'
    ];
  </code></pre>