r/javascript • • Jun 25 '14

AngularJS Coding Best Practices

http://vitalflux.com/angularjs-coding-best-practices/
0 Upvotes

2 comments sorted by

4

u/fecal_brunch Jun 25 '14

helloApp.controller( "HelloController", [$scope, function($scope){

This is wrong. First array element should be a string.

Also, I would expect some mention of the "controller as" syntax in a best practices guide. Injecting $scope should be avoided where possible, in my opinion and the opinion of many others in the Angular community.