title: Angular Material Example in TypeScript: Chips
body: <p>I'd like to recreate the chips example seen here (<a href="https://material.angularjs.org/latest/#/demo/material.components.chips" rel="nofollow">https://material.angularjs.org/latest/#/demo/material.components.chips</a>) in TypeScript, and as I'm fairly new (started learning it this week!), I'm a bit stuck with re-writing this from Javascript into TypeScript:</p>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>function mockLabels() {
        var labels = [
          {
            'name': 'hotel',
            'id': '1'
          },
          {
            'name': 'sport',
            'id': '2'
          },
          {
            'name': 'gaming',
            'id': '3'
          }           
        ];
        return labels.map(function (lab) {
          lab._lowername = lab.name.toLowerCase();
          return lab;
        });
      }
  </code></pre>
  
  <p><strong>TypeScript:</strong></p>
  
  <pre><code>private mockLabels: Array&lt;Label&gt; = [
              new Label(1, 'hotel'),
              new Label(2, 'sport'),
              new Label(3, 'gaming')
          ];
  
  public getLabels() {
              return this.mockLabels;         
          }
  </code></pre>
  
  <p>As you can see, I'm not sure how to include .map in my TypeScript code when it's been assigned to an array in TypeScript.</p>
  
  <p>How would I rewrite mockLabels to do so?</p>