S
S
Sergey2021-06-18 15:28:09
Angular
Sergey, 2021-06-18 15:28:09

A list of (for example) products and detailed information?

I started learning Angular and I had a question how to do the following. There is a page with a table of products and pagination, when you click on a product, detailed information opens. (1) On the one hand, this can be done as 2 separate components, each with its own router path, (2) but on the other hand, this can be done as a component and inside 2 others, and are displayed depending on the router path. You can give as an example gmail mail. I think how best to do it, because you can open it and go back, isn't it too expensive for my (1) option to generate a component every time

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lssssssssssl, 2021-06-18
@lsssssssssl

Do what will be cleaner and more understandable code. Since you have just started to study, you don’t need to invent something from the category “Is this too expensive, is not that too expensive?” If you can’t choose, write both options (There’s nothing wrong with that: you’re learning. Repetition is the mother of you know what), and then compare them, compare the resulting code with each other and think about which implementation came out better. If you can’t solve it yourself, then ask a question with specific code examples so that people can clearly see and help you. It makes no sense to describe some abstract architectures of your application: many will not even delve into your text.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question