@@ -2,7 +2,7 @@ var fs = require('fs');
2
2
var ejs = require ( 'ejs' ) ;
3
3
4
4
ejs . filters . q = function ( obj ) {
5
- return JSON . stringify ( obj , null , 2 ) ;
5
+ return JSON . stringify ( obj , null , 2 ) ;
6
6
} ;
7
7
8
8
/**
@@ -38,7 +38,7 @@ module.exports = function generateServices(app, ngModuleName, apiUrl) {
38
38
return ejs . render ( servicesTemplate , {
39
39
moduleName : ngModuleName ,
40
40
models : models ,
41
- urlBase : apiUrl . replace ( / \/ + $ / , '' )
41
+ urlBase : apiUrl . replace ( / \/ + $ / , '' ) ,
42
42
} ) ;
43
43
} ;
44
44
@@ -60,25 +60,25 @@ function describeModels(app) {
60
60
// the sharedCtor parameters should be added to the parameters
61
61
// of prototype methods.
62
62
c . methods . forEach ( function fixArgsOfPrototypeMethods ( method , key ) {
63
- if ( method . name == 'create' ) {
63
+ if ( method . name == 'create' ) {
64
64
var createMany = Object . create ( method ) ;
65
- createMany . name = 'createMany' ;
66
- createMany . isReturningArray = function ( ) { return true ; } ;
67
- c . methods . splice ( key + 1 , 0 , createMany ) ;
65
+ createMany . name = 'createMany' ;
66
+ createMany . isReturningArray = function ( ) { return true ; } ;
67
+ c . methods . splice ( key + 1 , 0 , createMany ) ;
68
68
}
69
69
var ctor = method . restClass . ctor ;
70
70
if ( ! ctor || method . sharedMethod . isStatic ) return ;
71
71
method . accepts = ctor . accepts . concat ( method . accepts ) ;
72
72
73
- if ( ! method . accepts ) return ;
73
+ if ( ! method . accepts ) return ;
74
74
75
75
// Any extra http action arguments in the path need to be added to the
76
76
// angular resource actions as params
77
77
method . accepts . forEach ( function findResourceParams ( arg ) {
78
- if ( ! arg . http ) return ;
78
+ if ( ! arg . http ) return ;
79
79
80
- if ( arg . http . source === 'path' && arg . arg !== 'id' ) {
81
- if ( ! method . resourceParams ) {
80
+ if ( arg . http . source === 'path' && arg . arg !== 'id' ) {
81
+ if ( ! method . resourceParams ) {
82
82
method . resourceParams = [ ] ;
83
83
method . hasResourceParams = true ;
84
84
}
@@ -152,7 +152,7 @@ function buildScopeMethod(models, modelName, method) {
152
152
153
153
modelClass . scopes [ scopeName ] = {
154
154
methods : { } ,
155
- targetClass : targetClass
155
+ targetClass : targetClass ,
156
156
} ;
157
157
} else if ( modelClass . scopes [ scopeName ] === null ) {
158
158
// Skip the scope, the warning was already reported
@@ -184,18 +184,18 @@ function buildScopeMethod(models, modelName, method) {
184
184
185
185
var reverseModel = findModelByName ( models , targetClass ) ;
186
186
reverseModel . methods . push ( reverseMethod ) ;
187
- if ( reverseMethod . name . match ( / c r e a t e / ) ) {
187
+ if ( reverseMethod . name . match ( / c r e a t e / ) ) {
188
188
var createMany = Object . create ( reverseMethod ) ;
189
- createMany . name = createMany . name . replace (
189
+ createMany . name = createMany . name . replace (
190
190
/ c r e a t e / ,
191
191
'createMany'
192
192
) ;
193
- createMany . internal = createMany . internal . replace (
193
+ createMany . internal = createMany . internal . replace (
194
194
/ c r e a t e / ,
195
195
'createMany'
196
196
) ;
197
- createMany . isReturningArray = function ( ) { return true ; } ;
198
- reverseModel . methods . push ( createMany ) ;
197
+ createMany . isReturningArray = function ( ) { return true ; } ;
198
+ reverseModel . methods . push ( createMany ) ;
199
199
}
200
200
201
201
var scopeMethod = Object . create ( method ) ;
@@ -204,7 +204,7 @@ function buildScopeMethod(models, modelName, method) {
204
204
scopeMethod . deprecated = false ;
205
205
scopeMethod . internal = false ;
206
206
modelClass . scopes [ scopeName ] . methods [ apiName ] = scopeMethod ;
207
- if ( scopeMethod . name . match ( / c r e a t e / ) ) {
207
+ if ( scopeMethod . name . match ( / c r e a t e / ) ) {
208
208
var scopeCreateMany = Object . create ( scopeMethod ) ;
209
209
scopeCreateMany . name = scopeCreateMany . name . replace (
210
210
/ c r e a t e / ,
0 commit comments