7

I was wanting to get peoples feedback with regards to creating controllers. Before I just had a few controllers but recently I have broken these out into many more controllers so I get better separation and maintenance...

But I am unsure if this was a good idea!

How many controllers are classes as too many?

For example, before I had a page that show 1 table and an inner table. So I had 1 controller before and now I have added another controller so that 1 controller manages the outer table and the other the inner controller.

Also navigation and sub navigation, I am now using a number of controllers for this where as before I was using just one controller.

is this best practice?

Thanks in advance

Martin
  • 23,844
  • 55
  • 201
  • 327
  • 2
    I don't think it's a big issue as long as they're named properly. We had a page with a main controller and then 8 tab controllers within it and it was still manageable. – Christopher Marshall Aug 01 '13 at 15:55
  • I wondered the same about here is some helpful info [Angular Best Practices](http://stackoverflow.com/q/20802798/1959948) – Dalorzo May 17 '14 at 22:42

1 Answers1

8

I think this blog post by Vlad Orlenko is a good take on how to structure a big angular project: AngularJS Best Practices: I’ve Been Doing It Wrong! Part 1 of 3

Skip right to the "Layout of src: feature-based modularization"

kobL
  • 23
  • 6
ravndal
  • 225
  • 1
  • 7