Beyond the boilerplate

the journey to writing maintainable code

caution:
the following contains angular

we are building applications

there are tools to help

javascript frameworks

help give structure

bring sanity to a complex solution

combine multiple frameworks/tools

app, testing, assertions, linting, etc

there's a tool for that

gulp and grunt

create custom tasks/builds

makes defining your workflow easier

configuring a build takes time

can be repetitive from project to project

there's a tool for that

yeoman

scaffolds the boilerplate

get you coding faster

what about structuring your app?

there's no tool for that

boilerplate is not YOUR app

not uncommon to see this

angular.module('myApp')
       .service('Every', function() {})
       .service('Service', function() {})
       .service('And', function() {})
       .controller('Controller', function() {})
       .controller('Ever', function() {})
       .directive('written', function() {});
       

or a more real world example:

angular.module('myApp')
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {})
       .service('UserService', function() {})
       .service('ActivitiesService', function() {})
       .service('MessagesService', function() {})
       .service('NotificationsService', function() {})
       .service('ErrorService', function() {})
       .service('ErrorInterceptor', function() {})
       .service('AuthInterceptor', function() {})
       .service('TrackingInterceptor', function() {})
       .controller('UserEditController', function() {})
       .controller('UserAddController', function() {})
       .controller('UserSearchController', function() {})
       .controller('ActivitiesListController', function() {})
       .controller('ActivitiesSearchController', function() {})
       .controller('MessageListController', function() {})
       .controller('MessageCreateController', function() {})
       .controller('ErrorController', function() {})
       .controller('NotificationsController', function() {})
       .directive('userProfile', function() {})
       .directive('userCard', function() {})
       .directive('userSummary', function() {})
       .directive('activitiesSummary', function() {})
       .directive('activitiesDetail', function() {})
       .directive('activitiesList', function() {})
       .directive('notificationBar', function() {})
       .directive('errorList', function() {})
       .directive('sideNav', function() {})
       .directive('footerNav', function() {})
       .directive('topNav', function() {});
       

and your directory structure?

/myApp
    /controllers
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
        UserEditController.js
        UserAddController.js
        UserSearchController.js
        ActivitiesListController.js
        ActivitiesSearchController.js
        MessageListController.js
        MessageCreateController.js
        ErrorController.js
        NotificationsController.js
    /services
        UserService.js
        ActivitiesService.js
        MessagesService.js
        NotificationsService.js
        ErrorService.js
        ErrorInterceptor.js
        AuthInterceptor.js
        TrackingInterceptor.js
        UserService.js
        ActivitiesService.js
        MessagesService.js
        NotificationsService.js
        ErrorService.js
        ErrorInterceptor.js
        AuthInterceptor.js
        TrackingInterceptor.js
        UserService.js
        ActivitiesService.js
        MessagesService.js
        NotificationsService.js
        ErrorService.js
        ErrorInterceptor.js
        AuthInterceptor.js
        TrackingInterceptor.js
        UserService.js
        ActivitiesService.js
        MessagesService.js
        NotificationsService.js
        ErrorService.js
        ErrorInterceptor.js
        AuthInterceptor.js
        TrackingInterceptor.js
        UserService.js
        ActivitiesService.js
        MessagesService.js
        NotificationsService.js
        ErrorService.js
        ErrorInterceptor.js
        AuthInterceptor.js
        TrackingInterceptor.js
        UserService.js
        ActivitiesService.js
        MessagesService.js
        NotificationsService.js
        ErrorService.js
        ErrorInterceptor.js
        AuthInterceptor.js
        TrackingInterceptor.js
    /directives
        userProfile.js
        userCard.js
        userSummary.js
        activitiesSummary.js
        activitiesDetail.js
        activitiesList.js
        notificationBar.js
        errorList.js
        sideNav.js
        footerNav.js
        topNav.js
        userProfile.js
        userCard.js
        userSummary.js
        activitiesSummary.js
        activitiesDetail.js
        activitiesList.js
        notificationBar.js
        errorList.js
        sideNav.js
        footerNav.js
        topNav.js
        userProfile.js
        userCard.js
        userSummary.js
        activitiesSummary.js
        activitiesDetail.js
        activitiesList.js
        notificationBar.js
        errorList.js
        sideNav.js
        footerNav.js
        topNav.js
        userProfile.js
        userCard.js
        userSummary.js
        activitiesSummary.js
        activitiesDetail.js
        activitiesList.js
        notificationBar.js
        errorList.js
        sideNav.js
        footerNav.js
        topNav.js
        userProfile.js
        userCard.js
        userSummary.js
        activitiesSummary.js
        activitiesDetail.js
        activitiesList.js
        notificationBar.js
        errorList.js
        sideNav.js
        footerNav.js
        topNav.js
        userProfile.js
        userCard.js
        userSummary.js
        activitiesSummary.js
        activitiesDetail.js
        activitiesList.js
        notificationBar.js
        errorList.js
        sideNav.js
        footerNav.js
        topNav.js
        userProfile.js
        userCard.js
        userSummary.js
        activitiesSummary.js
        activitiesDetail.js
        activitiesList.js
        notificationBar.js
        errorList.js
        sideNav.js
        footerNav.js
        topNav.js
        userProfile.js
        userCard.js
        userSummary.js
        activitiesSummary.js
        activitiesDetail.js
        activitiesList.js
        notificationBar.js
        errorList.js
        sideNav.js
        footerNav.js
        topNav.js
    app.js
    

how can you maintain that?

what about unit testing?

how about sharing that code?

your framework's modularity just died

along with your apps maintainability

we can fix this

find your app's key domain concepts

example:

User

Activities

Messages

create directories for YOUR app

/myApp
    /user
        ...
    /activities
        ...
    /messages
        ...
    ...
    

setup modules and dependencies

angular.module('myApp', [
    'user',
    'activities',
    'messages'
]);

re-organise your components

angular.module('user', [])
       .service('UserService', function() {})
       .controller('UserEditCtrl', function() {})
       .directive('userCard', function() {})
       

activities module needs user data?

pull out common functionality

angular.module('user', ['user.services'])
       .controller('UserEditCtrl', function() {})
       .directive('userCard', function() {})
       

this guy is now re-usable

angular.module('activities', ['user.services'])

maybe even open source?

simple folder structure

/myApp
    /user
        /controllers
            userEditCtrl.js
        /directives
            userCard.js
        user.js
        

or flatten it out?

/myApp
    /user
        user.module.js
        userCard.directive.js
        userEdit.ctrl.js
        

don't stop at your javascript

split up your other assets too!

structure your code for devs

/myApp
    /user
        user.module.js
        userCard.directive.js
        userCard.view.html
        userCard.less
        userDefaultAvatar.png
        userEdit.ctrl.js
        

shape your code for efficient development

leave optimizations for build tools

testability

less stubbing, efficient, higher coverage

beforeEach(module('user'))

maintainability

when there's a bug in activities list...

/myApp
    /activities
        activities.module.js
        activityItem.directive.js
        activityItem.view.html
        activityItem.less
        activitiesList.ctrl.js
        

delete-ability!

no rogue css rules

no image assets left behind

modularity is awesome!

its what frameworks do well

its what boilerplate can't

write apps that go beyond the boilerplate

for your fellow devs... and yourselves

thank you

@michaeltaranto

bit.ly/beyondtheboilerplate