r/angularjs • • Oct 19 '15

Refactoring Angular Apps to Component Style

http://teropa.info/blog/2015/10/18/refactoring-angular-apps-to-components.html
81 Upvotes

9 comments sorted by

10

u/vinnl Oct 19 '15

I'm stuck at step 0, convincing my co-works to switch to component style :P

3

u/theromz Oct 19 '15

Ditto, I'm getting to refactor a big angularJS app, co-workers don't want too use anything new, CTO just told me to download a theme and magically use that :X.

1

u/dhca78 Oct 22 '15

What got you into refactoring the Angular codebase? Are your coworkers really into programming or is it just a job to them? If they really like programming, then I think just showing them how clean the codebase will be after componentizing them should rile them up. If not, you can just refactor just a directive or two and reuse them, and show how much time you've saved. The biggest motivation for me, is the upcoming web components standard and how far behind our codebase will be in the future if we don't refactor.

1

u/vinnl Oct 23 '15

I actually ran into this for a new project that I had set up using the component style. The main comment was "this is different from how we're used to doing it, so it will take the rest of the team more time to comprehend the code base". There's some merit to that argument, and in this case the advantage was non-obvious: the component wasn't actually re-used, the main advantage being encapsulation and future-readiness. Unfortunately, they're either the type for whom programming is just a job, or consider front-end work just a necessary evil part of the job, so yeah...

5

u/mrpeabodynsherman Oct 19 '15

This is an amazing resource. I feel like this has been a topic on the tip of many Angular developer's tongues for a while now. So glad to see such a comprehensive and intelligent article. Can't wait for Angular 2!

1

u/dhca78 Oct 22 '15

Teropa is pretty much an Angular celebrity thanks to all the helpful guides he pushes out. This one was awesome.

4

u/compubomb Oct 19 '15

This is a super high quality tutorial on refactoring legacy angular 1.x code into more modular 1.x component directives. Very good source.

4

u/guywithalamename Oct 19 '15

Definitely one of the best and most in-depth articles I've read on the topic. Upvoted!

1

u/martyd Oct 19 '15

This was an amazing read, thanks for sharing