Skip to content

feat: ДЗ 9. Реализация навигации по субкатегории #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: lecture-9
Choose a base branch
from

Conversation

aleksUkolov
Copy link

No description provided.

Copy link
Owner

@Letto228 Letto228 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Привет!
Оставил пару комментариев, посмотри, пожалуйста

@@ -38,6 +38,10 @@ const routes: Routes = [
},
],
},
{
path: ':id',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему решил добавить отдельным динамическим сегментом :id? Почему не в связке products-list/:id. На мой взгляд пути для отображения списка продуктов - products-list and products-list/:id выглядят консистентней нежели products-list and :id.
Что думаешь?

@@ -12,6 +12,7 @@
mat-button
hideToggle
class="sub-catigory"
[routerLink]="[subCategory._id]"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А как думаешь, какая навигация тут должна быть: абсолютная или относительная?

constructor(private readonly router: Router) {
}

onClick(subCategory: string){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Уже не нужно? Осталось после тестирования другой реализации?

Comment on lines +28 to +33
if(subCategoryId){
this.productsStoreService.loadProducts(subCategoryId)
return
}
this.productsStoreService.loadProducts()
})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему не просто передаешь subCategoryId в метод? Он же умеет работать с null🤔

Suggested change
if(subCategoryId){
this.productsStoreService.loadProducts(subCategoryId)
return
}
this.productsStoreService.loadProducts()
})
this.productsStoreService.loadProducts(subCategoryId)
})

Comment on lines +24 to +26
map(paramMap=>{
return paramMap.get("id")
}),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Рекомендую в таких случаях сокращать запись

Suggested change
map(paramMap=>{
return paramMap.get("id")
}),
map(paramMap => paramMap.get("id")),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants