Hi Dimitar Ginev, thanks, that’s a great comment.
Given my experience with this specific task, I am aware things will eventually start to diverge a lot as you’re saying, and while they maybe do belong to some extent to the same hierarchy, things will likely get messy (and lol, they did!).
That’s surely another way. I personally prefer using DI though.
Using an interceptor feels more obscure and it’s also more Angular-specific. Using a facade is a proven design pattern, it helps to think about the API and its pretty powerful when your class is more than 2-3 simple methods.
Hi Valentin Parsy,
What would you like to know in more detail? I’d be happy to write more about it of course.
Mixins certainly require more typing, and are a little verbose. With that said, I like how they can extend classes without having to lock down my design to a base class. I found it very…
Hi Lars Gyrup Brink Nielsen,
This may have been misworded from my side: I meant that it has become fairly standard within the front end community to adopt a state management solution (or anything like that, such as using services or Singletons) rather than simply putting everything in components, just like in the early old days with Angular 1 :)
Hi Andrei, thanks for reading!
I think creating helper methods through a service (or maybe better, helper methods imported as functions?) is a viable solution with no clear downsides: I should have probably mentioned it!
It’s always a good idea to put logic outside of the component if this is…