U
U
Urukhayy2017-09-20 13:46:32
PHP
Urukhayy, 2017-09-20 13:46:32

How to make sure the architecture of an Angular 4(2) application is correct?

I have an Angular 4 application that has many similar components (with similar fields and buttons, but different data). As soon as you need to add the same functionality to all these similar components, the routine begins: a full copy-paste of the new functionality to all files, followed by changing the names of the variables. It seems to me that this is not the best implementation of the architecture. Maybe you need to make a generic component that dynamically builds the DOM?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fedor Sazonov, 2017-09-25
@Revenant20

Well, you can make an abstract class from which your similar components will be inherited. The general can be taken out in an abstract class.
Instead of an abstract class, you can make a class in which everything will also be common, and make it a member of the component and then pull its methods and variables.

S
sim3x, 2017-09-20
@sim3x

https://addyosmani.com/resources/essentialjsdesign...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question