Angular: Bad Practices/Patterns

Ryan Mackey-Paulsen
2 min readJan 24, 2020

--

You did what with your Angular?

I have been working with angularjs for a long time now. I have been working with Angular since it was in alpha. One thing that I have seen over the years is the ability for developers to use design and development patterns that seem to be at odds with Angular. This could be because they don’t have a background with Angular. It could be because they don’t like Angular or components in general.

Whatever the case, taking bad practices and patterns and building large applications around them is obviously a bad idea. This can lead to overly complicated functionality or even bad and confusing UI. One of the good things about Angular is that it takes a very simple pattern, components, and builds off of them. You start small and your components are self contained and can be isolated and then used and combined to make larger components and even applications. This concept is not new as Web Components are standard and other UI libraries do this exact same thing.

So what bad practices and patterns are out there and how can we correct them? In this series, I will find examples and explain how they can be improved. If you see these in your code base, feel free to comment on your take and how you would fix it.

The Problems

The Proxy Service Pattern

Services That Touch the DOM

Not Using Form Controls for Inputs

Form Controls for Specific Data Sources

Using Too Many Services

--

--

Ryan Mackey-Paulsen

Web App Developer, Web Component Enthusiast, Musician, Human