Hacker News new | ask | show | jobs
by declandewet 4262 days ago
I know that you only have one controller, but I don't think it's wise to reference each and every controller in one single angular.module(...).controller() declaration... Perhaps read this: https://github.com/gocardless/angularjs-style-guide

Also, it might be worth looking at ng-annotate so you don't have to specify the array of dependencies. It's not necessary but it does help speed up development a little bit, not having to type that out all the time - it can get quite unruly sometimes. :P

Further than that, you need to implement unit testing, as well as end-to-end testing with Angular Protractor. I've been on a large scale Angular project without any testing in place, and boy did I give the lead my two cents about how much trouble that caused us. The project was delivered 2 weeks late because of buggy, untested code. Prevent this as soon as you can.

1 comments

You catch a good spot, thanks ! In future i will create multiple controllers, sure depends with the logical concern.

I will read read style guide and ng-annotate.

Unit testing is crucial you are right. I need to add to seed project.

By the way what do you think about this article ? http://www.wintellect.com/blogs/jlane/five-reasons-asp.net-d...

If you're looking for a more opinionated and structured way of doing controllers then take a look at my project. It also means that you don't need to use build tools like ng-annotate.

http://davej.github.io/angular-classy/