fix: playlists is undefined in init state

This commit is contained in:
Gary Wang 2020-07-14 10:24:33 +08:00
parent 9a2e88d016
commit cb122ecdba
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
})
export class DataproviderService {
private apiUrl = "http://127.0.0.1:616/api.php";
private apiUrl = "http://127.0.0.1:4000/api.php";
constructor(
private http: HttpClient
@ -64,7 +64,7 @@ export class DataproviderService {
mock_FILELISTAAAA : FileList;
mock_FILELISTBBBB : FileList;
getFileList(path : string) : Observable<FileList> {
getFileListReal(path : string) : Observable<FileList> {
switch (path) {
case "AAAA":
return of(this.mock_FILELISTAAAA);
@ -75,7 +75,7 @@ export class DataproviderService {
}
}
getFileListReal(path : string) : Observable<FileList> {
getFileList(path : string) : Observable<FileList> {
const body = new HttpParams()
.set('do', 'getfilelist')
.set('folder', path);

View File

@ -1,4 +1,4 @@
<mat-nav-list>
<mat-nav-list *ngIf="filelist">
<mat-list-item *ngFor="let folderItem of filelist.subFolderList" (click)="requestPlaylist(folderItem)">
<mat-icon matListIcon>folder</mat-icon>
<a>{{ folderItem }}</a>