Add search publication page and fix category access
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<div class="sub-category-container {{category.isOpenned ? 'displayed' : ''}}">
|
||||
@for(subCategory of category.subCategories; track subCategory) {
|
||||
<a [routerLink]="['/categories/' + subCategory.id]" class="sub-category">
|
||||
<a [routerLink]="['/publications']" [queryParams]="{'category-id': subCategory.id}" (click)="categoryClicked.emit()" class="sub-category">
|
||||
{{subCategory.name}}
|
||||
</a>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { Component, inject, OnInit } from "@angular/core";
|
||||
import { Component, EventEmitter, inject, OnInit, Output } from "@angular/core";
|
||||
import { MatIconModule } from "@angular/material/icon";
|
||||
import { DisplayableCategory, SideMenuService } from "../side-menu.service";
|
||||
import { Observable } from "rxjs";
|
||||
@@ -14,6 +14,8 @@ import { RouterModule } from "@angular/router";
|
||||
})
|
||||
export class CategoriesMenuComponent implements OnInit {
|
||||
private sideMenuService = inject(SideMenuService);
|
||||
@Output()
|
||||
categoryClicked = new EventEmitter<void>();
|
||||
|
||||
ngOnInit(): void {
|
||||
this.sideMenuService.loadCategories();
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
</button>
|
||||
</h1>
|
||||
<h2>Catégories</h2>
|
||||
<app-categories-menu></app-categories-menu>
|
||||
<app-categories-menu (categoryClicked)="close()"></app-categories-menu>
|
||||
</div>
|
||||
<div class="overlay {{ isOpenned ? 'displayed' : ''}}" (click)="close()"></div>
|
||||
|
||||
Reference in New Issue
Block a user