This repository has been archived by the owner on Mar 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(service-generator): fix break in Angular-Sub-Generator API o…
…f service-generator, remove argument --type and create own generators for each type
- Loading branch information
1 parent
54edc9d
commit 5b6a4b6
Showing
9 changed files
with
117 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Description: | ||
Creates a new AngularJS service. | ||
Docs: http://docs.angularjs.org/guide/dev_guide.services.creating_services | ||
|
||
Example: | ||
yo angular:constant thing [--coffee] [--minsafe] | ||
|
||
This will create: | ||
app/scripts/services/thing.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
var path = require('path'); | ||
var util = require('util'); | ||
var ScriptBase = require('../script-base.js'); | ||
var angularUtils = require('../util.js'); | ||
|
||
|
||
module.exports = Generator; | ||
|
||
function Generator() { | ||
ScriptBase.apply(this, arguments); | ||
} | ||
|
||
util.inherits(Generator, ScriptBase); | ||
|
||
Generator.prototype.createServiceFiles = function createServiceFiles() { | ||
this.appTemplate('service/constant', 'scripts/services/' + this.name); | ||
this.testTemplate('spec/service', 'services/' + this.name); | ||
this.addScriptToIndex('services/' + this.name); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Description: | ||
Creates a new AngularJS service. | ||
Docs: http://docs.angularjs.org/guide/dev_guide.services.creating_services | ||
|
||
Example: | ||
yo angular:factory thing [--coffee] [--minsafe] | ||
|
||
This will create: | ||
app/scripts/services/thing.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
var path = require('path'); | ||
var util = require('util'); | ||
var ScriptBase = require('../script-base.js'); | ||
var angularUtils = require('../util.js'); | ||
|
||
|
||
module.exports = Generator; | ||
|
||
function Generator() { | ||
ScriptBase.apply(this, arguments); | ||
} | ||
|
||
util.inherits(Generator, ScriptBase); | ||
|
||
Generator.prototype.createServiceFiles = function createServiceFiles() { | ||
this.appTemplate('service/factory', 'scripts/services/' + this.name); | ||
this.testTemplate('spec/service', 'services/' + this.name); | ||
this.addScriptToIndex('services/' + this.name); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Description: | ||
Creates a new AngularJS service. | ||
Docs: http://docs.angularjs.org/guide/dev_guide.services.creating_services | ||
|
||
Example: | ||
yo angular:provider thing [--coffee] [--minsafe] | ||
|
||
This will create: | ||
app/scripts/services/thing.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
var path = require('path'); | ||
var util = require('util'); | ||
var ScriptBase = require('../script-base.js'); | ||
var angularUtils = require('../util.js'); | ||
|
||
|
||
module.exports = Generator; | ||
|
||
function Generator() { | ||
ScriptBase.apply(this, arguments); | ||
} | ||
|
||
util.inherits(Generator, ScriptBase); | ||
|
||
Generator.prototype.createServiceFiles = function createServiceFiles() { | ||
this.appTemplate('service/provider', 'scripts/services/' + this.name); | ||
this.testTemplate('spec/service', 'services/' + this.name); | ||
this.addScriptToIndex('services/' + this.name); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Description: | ||
Creates a new AngularJS service. | ||
Docs: http://docs.angularjs.org/guide/dev_guide.services.creating_services | ||
|
||
Example: | ||
yo angular:value thing [--coffee] [--minsafe] | ||
|
||
This will create: | ||
app/scripts/services/thing.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
var path = require('path'); | ||
var util = require('util'); | ||
var ScriptBase = require('../script-base.js'); | ||
var angularUtils = require('../util.js'); | ||
|
||
|
||
module.exports = Generator; | ||
|
||
function Generator() { | ||
ScriptBase.apply(this, arguments); | ||
} | ||
|
||
util.inherits(Generator, ScriptBase); | ||
|
||
Generator.prototype.createServiceFiles = function createServiceFiles() { | ||
this.appTemplate('service/constant', 'scripts/services/' + this.name); | ||
this.testTemplate('spec/service', 'services/' + this.name); | ||
this.addScriptToIndex('services/' + this.name); | ||
}; |