First at all, just say that there is a lot of different forms to structure your projects. This is one of many, but is what I feel more confortable with:
Files and folders: name-of-fileVariables: CamelCase nameOfVariableFunctions: CamelCase nameOfFunction()Classes: UpperCamelCase NameOfFunction()
Controllers
For Controllers, we will use UpperCamelCase, with "Controller" as the ending word in the controller name, but not in the file. Example:
controllers/user.js
app.module('app').
controller('UserController', userController);
function userController(...) { ... }
Services
For Services, just the name of what it do, in camelCase. Example:
services/user.js
angular.module("app")
.factory("user", userService);
function userService(...) { ... }
Directives
A #1 directive is a function totally abstract of the context. It will became a html property, so the naming will be exactly what is. We will use camelCase, in directive.js, and html valid name (separe-words-like-this) as the html tag or param. Example:
directive/list-element.js
app.module('app').
directive('listElement', listElementDirective);
function listElementDirective(...) { ... }
First at all, just say that there is a lot of different forms to structure your projects. This is one of many, but is what I feel more confortable with:
Naming
Files and folders: name-of-file Variables: CamelCase nameOfVariable Functions: CamelCase nameOfFunction() Classes: UpperCamelCase NameOfFunction()
Controllers
For Controllers, we will use UpperCamelCase, with "Controller" as the ending word in the controller name, but not in the file. Example:
controllers/user.js
Services
For Services, just the name of what it do, in camelCase. Example:
services/user.js
Directives
A #1 directive is a function totally abstract of the context. It will became a html property, so the naming will be exactly what is. We will use camelCase, in directive.js, and html valid name (separe-words-like-this) as the html tag or param. Example:
directive/list-element.js
index.html