title: Angular Mentions - Save ID value of the selected users
body: <p>With the help of the angular mentions library, I implemented a textarea that allows me to mention several users.</p>
  
  <p>Is there a way to save the ID of the selected users? If possible save them as an array of strings.</p>
  
  <p>Example: I selected users Name 1, Name 2, Name 3 .... I want to be able to save the id and not the name. ["1", "2", "3"]</p>
  
  <p>Can anyone help me?</p>
  
  <p>Thanks!</p>
  
  <p><a href="https://stackblitz.com/edit/angular-xxez2r?file=src%2Fapp%2Fapp.component.html" rel="nofollow noreferrer">Stackblitz</a></p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code> &lt;div [mention]="items" class="form-control" contenteditable="true" style="border:1px lightgrey solid;min-height:88px" [mentionConfig]="{triggerChar:'@',labelKey:'name'}"&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>Component.ts</strong></p>
  
  <pre><code> items: string[];
    constructor(private userService: UserService) {}
  
    ngOnInit() {
      this.userService.getUsers().subscribe(
        (val: any[]) =&gt;{
          this.items = val;
        } 
      )
    }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/hzAew.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hzAew.png" alt="Image"></a></p>