forked from yeoman/generator-angular
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (18 loc) · 697 Bytes
/
Copy pathindex.js
File metadata and controls
24 lines (18 loc) · 697 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
'use strict';
var path = require('path');
var util = require('util');
var ScriptBase = require('../script-base.js');
module.exports = Generator;
function Generator() {
ScriptBase.apply(this, arguments);
// if the controller name is suffixed with ctrl, remove the suffix
// if the controller name is just "ctrl," don't append/remove "ctrl"
if (this.name && this.name.toLowerCase() !== 'ctrl' && this.name.substr(-4).toLowerCase() === 'ctrl') {
this.name = this.name.slice(0, -4);
}
}
util.inherits(Generator, ScriptBase);
Generator.prototype.createControllerFiles = function createControllerFiles() {
this.appTemplate('controller');
this.testTemplate('spec/controller');
};