[Angular] 加入在 asset 資料夾中的 json 檔案
TS檔
private jsonURL = 'assets/KYC/response_1609924740023.json';
constructor(
private httpClient: HttpClient,
) {
this.getJSON().subscribe(data => {
this.KycQuestionObj = data;
});
}
public getJSON(): Observable<any> {
return this.httpClient.get(this.jsonURL);
}
留言
張貼留言