title: how to create a list of object using json in Angular?
body: <p>Hi I'd like to create a small authentication service in my angular application, I have a JSON file containing the information about my users:</p>
  
  <pre><code>{
    "Users": [
      {
        "type":"teacher",
        "id":0,
        "name":"TEACHER ONE",
        "login":"tone",
        "password":"d450c5dbcc10db0749277efc32f15f9f"
      },
      {
        "type":"student",
        "id":1,
        "name":"STUDENT ONE",
        "login":"sone",
        "password":"ec80dcc5a3eab73a4f128b66c1e4b92a"
      },
      {
        "type":"student",
        "id":2,
        "name":"STUDENT TWO",
        "login":"stwo",
        "password":"62e73bf0deb1871860702b064106f1dc"
      }
    ]
  }
  
  </code></pre>
  
  <p>and here's what I try for my authentifiaction</p>
  
  <pre class="lang-js prettyprint-override"><code>import { Injectable } from '@angular/core';
  import * as users from '../assets/Users.json';
  import { clientType } from "./clientType";
  
  @Injectable({
    providedIn: 'root'
  })
  class user {
    $type: clientType; //I put a dollar so equals won't compare this property
    $id: number; //I put a dollar so equals won't compare this property
    $name: string; //I put a dollar so equals won't compare this property
    login: string;
    password: string;
  
    constructor(type: clientType, id: number, name: string, login: string, password: string) {
      this.$type = type;
      this.$id = id;
      this.$name = name;
      this.login = login;
      this.password = password;
    }
  
  
  }
  
  export class AuthService {
    private userList: /*don't know what to put*/ = /*don't know what to put*/;
    constructor() { }
    consultData( ): void{
    }
  
    returnUsers() {
      return this.userList;
    }
  }
  
  </code></pre>
  
  <p>I'm trying to get an array of users using my JSON file but I don't know how to extract the JSON object as <code>user</code> objects, can someone help me finding how ?</p>