DEV Community

Discussion on: Angular Routing - Best Practices for Enterprise Applications

Collapse
 
wesgrimes profile image
Wes

Thanks for the feedback Michael. I appreciate your opinion! It is always great to get feedback on articles that I write.

The concepts laid out in my article are recommendations and preferences. I realize others may not wish to implement ideas in the same manner, and that's OK.

I use the Angular CLI exclusively and these best practices work great with the CLI.

That being said, I would like to counter your claims with the following:

  • On Barrel index.ts exports: John Papa and Todd Motto both use barrel exports heavily, it's where I got the idea from. You can see their repos here using barrels: github.com/johnpapa/heroes-angular... and Todd's tweet for reference: twitter.com/toddmotto/status/91881...

  • On Folders with leading underscore: This is just a recommendation, and it works fantastic for my team. I have not run across any negative consequences from this. It's quite common out in the wild with several high starred github repos using this.

  • On Guards - I agree they are a type of service, but they have very unique use-cases, and can only be used directly with route definition. This is why I store them close to the source of use.

Collapse
 
wesgrimes profile image
Wes

And again thanks for the feedback. I always appreciate it! Hope you’re having a great day!

Collapse
 
michaeljota profile image
Michael De Abreu

I have admiration for both, but I also have found that this patterns doesn't fit with Angular very well. They are more like React, or Vue. You can use them, but they don't fit. I don't know if I explain myself. However, it's like you said, sometimes, sometimes not.

Thread Thread
 
wesgrimes profile image
Wes

Well thanks again for your feedback! Would love to see how you’re building Angular apps for comparison sake. Maybe I’m missing something. If you haven’t already, how about writing an article?

Thread Thread
 
michaeljota profile image
Michael De Abreu

Sure do. I have already write a couple, but nothing specific to organization structure, as I have found the Angular Style Guide a really good approach to manage. I have work in a couple of projects with Angular, and in all of them we always followed the ASG. Sometimes we add something, or adjust something, but it would still the recommended structure.

Thread Thread
 
wesgrimes profile image
Wes

That’s great! I am a big fan of the style guide. I use it as a base for most things, but I do on occasion break from the norm where it makes sense for my team and our deliverables. Have a great day!