title: array of object type in typescript with angular2
body: <p>in my angular application I want to use an array of object of id and role in below manner</p>
  
  <pre><code>let userRole: Array&lt;...&gt; = [
                         { id: 1, name: 'Admin' },
                         { id: 2, name: 'Super Admin' },
                         { id: 2, name: 'User' },
                         { id: 2, name: 'Watcher' }
                      ];
  </code></pre>
  
  <p>BUT I am confused what need to fill up in place of <strong><em>...</em></strong> ?</p>
  
  <p><code>Array &lt; Object &gt;</code> or <code>Array &lt;Any&gt;</code></p>
  
  <p><strong>Trial 1 :</strong>  </p>
  
  <p><code>var role = {
              id: number;
              name: string;
          };</code></p>
  
  <p>and then <code>Array &lt;role&gt;</code> but it gives error</p>
  
  <p><strong>Trial 2 :</strong>  adding with different class file</p>
  
  <h3>role.ts</h3>
  
  <pre><code>export class Role {
      constructor(
          public id: number,
          public name: string
      ) { }
  }
  </code></pre>
  
  <p>and add in my file as</p>
  
  <pre><code>import { Role }      from './role';
  
  export class HeroFormComponent {
  
     let userRole: Array&lt;Role&gt; = [
                         { id: 1, name: 'Admin' },
                         { id: 2, name: 'Super Admin' },
                         { id: 2, name: 'User' },
                         { id: 2, name: 'Wacher' }
                      ];
  </code></pre>
  
  <p>But gives error</p>
  
  <p><strong>Error: SyntaxError: Unexpected strict mode reserved word</strong></p>