Fix categories loading in side menu component.
This commit is contained in:
1 parent
5e4068b141
commit
d9b856bd43
6 files changed
+75
-37
No files matched your search
@@ -17,8 +17,8 @@ export class CategoryService {
|
||||
get categories$(): Observable<Category[]> {
|
||||
if (!this.categories?.length) {
|
||||
this.categoryRestService.getCategories()
|
||||
.then(categories => this.categoriesSubject.next(categories))
|
||||
.catch(error => console.error('An error occured while loading categories.', error));
|
||||
.then(categories => this.categoriesSubject.next(categories))
|
||||
.catch(error => console.error('An error occured while loading categories.', error));
|
||||
}
|
||||
return this.categoriesSubject.asObservable();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user