title: Cannot assign a type to a string in angular
body: <p>hey guys i need help i cannot push a string property to an key,value Array&lt;{name:string}&gt;;
  I have</p>
  <pre><code>         selRoles!: Array&lt;{name:string}&gt;;
  
  
  
    // then i try to map the role.names to the typed Array&lt;{name:string}&gt;.because the map function returns an Array&lt;string&gt; without the type name? 
    this.selRoles = data.roles.map(role =&gt; role.name);
  
    //here is my subscribe method which returns some rest data
    this.userService.getUserById(this.id).subscribe(data =&gt; {
          this.user = data; 
        // i also tried to use forEach with type like this
  
        data.roles.forEach(role =&gt; this.selRoles.push({name:role.name}));
        console.log(&quot;selRoles &quot; +this.selRoles.forEach(item =&gt; item.name));
  }, 
  error =&gt; console.log(error)
  )
  </code></pre>
  <p>There is always an error which VC code describes as follows
  Argument of type 'string' is not assignable to parameter of type '{ name: string; }'.ts(2345)</p>
  <p>How can i assign a type as property of the string? can you help me out. is very appreciated.thanks</p>