fix: playlists is undefined in init state
This commit is contained in:
parent
9a2e88d016
commit
cb122ecdba
@ -9,7 +9,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|||||||
})
|
})
|
||||||
export class DataproviderService {
|
export class DataproviderService {
|
||||||
|
|
||||||
private apiUrl = "http://127.0.0.1:616/api.php";
|
private apiUrl = "http://127.0.0.1:4000/api.php";
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient
|
private http: HttpClient
|
||||||
@ -64,7 +64,7 @@ export class DataproviderService {
|
|||||||
mock_FILELISTAAAA : FileList;
|
mock_FILELISTAAAA : FileList;
|
||||||
mock_FILELISTBBBB : FileList;
|
mock_FILELISTBBBB : FileList;
|
||||||
|
|
||||||
getFileList(path : string) : Observable<FileList> {
|
getFileListReal(path : string) : Observable<FileList> {
|
||||||
switch (path) {
|
switch (path) {
|
||||||
case "AAAA":
|
case "AAAA":
|
||||||
return of(this.mock_FILELISTAAAA);
|
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()
|
const body = new HttpParams()
|
||||||
.set('do', 'getfilelist')
|
.set('do', 'getfilelist')
|
||||||
.set('folder', path);
|
.set('folder', path);
|
||||||
|
@ -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-list-item *ngFor="let folderItem of filelist.subFolderList" (click)="requestPlaylist(folderItem)">
|
||||||
<mat-icon matListIcon>folder</mat-icon>
|
<mat-icon matListIcon>folder</mat-icon>
|
||||||
<a>{{ folderItem }}</a>
|
<a>{{ folderItem }}</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user