DEV Community

Discussion on: The Best Way to build reactive sub-forms with Angular

Collapse
 
jwp profile image
John Peters

Nice Tomas; this is what I call refactoring duplication based only on coding patterns! As you know the power of properly used DI, allows us to look at patterns that may repeat, without regard to context. In fact, the concepts of injecting behaviors into templates is what Angular is all about, and it doesn't have to be just code, it can also include html templates. Need to abstract common things to one-time-one-place, in Angular it's "cd ../common; ng g c myCommonThing" works every time and takes about 2 seconds to type that line.