-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy pathfunction-type.js
More file actions
27 lines (22 loc) · 814 Bytes
/
function-type.js
File metadata and controls
27 lines (22 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// example - valid: true, options: ["anonymous"]
angular.module('myModule').factory('myService', function () {
// ...
});
// example - valid: true, options: ["named"]
angular.module('myModule').factory('myService', function myService() {
// ...
});
// example - valid: true, options: ["named"]
angular.module('myModule').factory('myService', myServiceFn);
function myServiceFn() {
// ...
}
// example - valid: false, options: ["named"], errorMessage: "Use named functions instead of anonymous function"
angular.module('myModule').factory('myService', function () {
// ...
});
// example - valid: false, options: ["anonymous"], errorMessage: "Use anonymous functions instead of named function"
angular.module('myModule').factory('myService', myServiceFn);
function myServiceFn() {
// ...
}