Community-driven set of best practices for AngularJS application development
Not sure if there is a better place to ask this but I'm confused.
It is stated:
"The controllers should not be defined as globals..."
But then:
Use the following syntax for defining controllers:
function MyCtrl(dependency1, dependency2, ..., dependencyn) { // ... }
module.controller('MyCtrl', MyCtrl);
Isn't that function definition global? As opposed to:
module.controller('MyCtrl', function MyCtrl(dependency1, dependency2, ..., dependencyn) { // ... });
Yes, you can define your controller with:
function MyCtrl(dependency1, dependency2, ..., dependencyn) { // ... }
module.controller('MyCtrl', MyCtrl);
and later, after gulp-wrap
is used, your code will look like:
(function () {
function MyCtrl(dependency1, dependency2, ..., dependencyn) { // ... }
module.controller('MyCtrl', MyCtrl);
}());
run e2e tests each time before you deploy your application
develop
. Once all the tests pass, a new release is triggered. However, it happens that some e2e are failing due to a missing backend feature which is still in development and we want to realease our client any way.
controllers
directory would it be /controllers/content-data/HammerCtrl.js
or /controllers/contentData/HammerCtrl.js?