📜  如何从 Angular 中读取资产 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:40.247000             🧑  作者: Mango

代码示例1
private httpClient: HttpClient;

  constructor(http: HttpClient) {
    this.httpClient = http;
  }

this.httpClient.get('assets/Maze1.txt', { responseType: 'text' })
      .subscribe(data => console.log(data));