feat(pages): Add and configure routing for About and Contact pages#5
feat(pages): Add and configure routing for About and Contact pages#5aslan-es wants to merge 1 commit into
Conversation
| @@ -0,0 +1,40 @@ | |||
| @if (book(); as bookData) { | |||
There was a problem hiding this comment.
این if خوب نیست
اگه میخوای چیزی رو چک کنی برو کامپوننت پدرش چک کن
| @@ -0,0 +1,125 @@ | |||
| :host { | |||
| display: flex; | |||
There was a problem hiding this comment.
این استایل هارو از هم جدا کنین یکم مرتب تر بشه
طبق چیزی که تو داک هست
| standalone: true | ||
| }) | ||
| export class BookDetailComponent{ | ||
|
|
There was a problem hiding this comment.
چرا اینطوری از injector استفاده میکنید ؟
| @@ -0,0 +1,114 @@ | |||
| <div class="form-container"> | |||
There was a problem hiding this comment.
کامپوننت خیلی خیلی خیلی بزرگه
شکسته بشه
| }); | ||
| } | ||
|
|
||
| ngOnInit(): void { |
There was a problem hiding this comment.
هیچکدوم از متد ها accesss modifier ندازه
| export class HeaderComponent { | ||
| searchControl = new FormControl<string | null>(''); | ||
|
|
||
| searchTerm = toSignal(this.searchControl.valueChanges.pipe( |
| @@ -0,0 +1,99 @@ | |||
| .static-page-container { | |||
There was a problem hiding this comment.
اینارو مرتب کنید
طبق داک
|
|
||
|
|
||
| constructor(private http: HttpClient) { | ||
| this.loadInitialData(); |
| public filteredBooks = computed(()=> { | ||
| const term = this.searchTerm(); | ||
| const books = this.books(); | ||
| if (!term){ |
There was a problem hiding this comment.
item != null
کلا سعی کنید هیچ موقع نرید
truthy چک کنید
همیشه null check
کنید
اگرم سواله براتون چرا سرچ کنید زیاد ممقاله میاد
| } | ||
|
|
||
|
|
||
| searchBooks(term: string) { |
| @@ -0,0 +1,113 @@ | |||
| import {HttpClient} from '@angular/common/http'; | |||
| public imagePreview = signal<string | null>(null); | ||
| public selectedFile = signal<File | null>(null); | ||
|
|
||
| addBookForm = new FormGroup({ |
| private route = inject(ActivatedRoute); | ||
| private router = inject(Router); | ||
|
|
||
| constructor() { |
| private searchEffect = effect(() => { | ||
| const currentTerm = this.searchTerm(); |
There was a problem hiding this comment.
effect رو همیشه بهتره تو
constructor
بزنیم تمیز تر میشه
| @@ -0,0 +1,63 @@ | |||
| .static-page-container { | |||
There was a problem hiding this comment.
بر اساس داک مرتب کنیپد
This PR introduces two new static pages to the application:
AboutComponentandContactComponent./aboutand/contactin the main routing configuration.