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

2
  • 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. Commented Aug 1, 2013 at 15:55
  • I wondered the same about here is some helpful info Angular Best Practices Commented May 17, 2014 at 22:42

1 Answer 1

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"

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.