Skip to content

Commit ffeb50e

Browse files
committed
Fixed module generation and scripts import
1 parent 859994a commit ffeb50e

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

angular-app-base.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ var Generator = module.exports = function AngularAppBase(args, options) {
5656
this.appPath = angularUtils.replaceBackSlashesWithSlashes(path.join(this.srcPath, this.modulesPath, this.appName));
5757
this.bowerDependenciesLocation = angularUtils.replaceBackSlashesWithSlashes(path.join(this.srcPath, this.scriptsPath));
5858
this.appScriptsTestPath = angularUtils.replaceBackSlashesWithSlashes(path.join(this.testPath, this.modulesPath, this.appName, this.scriptsTestPath));
59+
this.env.options.appName = this.appName;
60+
this.modules = this.modulesConfig.modules || {};
61+
this.modules[this.appName] = this.appPath;
62+
this.modulesAsJSON = JSON.stringify(this.modules);
5963
}
6064

6165
if (this.env.options.appName) {

app/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,11 @@ Generator.prototype.requireAppName = function askForAppName() {
109109
} else {
110110
this.appName = props.appName;
111111
this.resolveModule(this.appName);
112-
this.env.options.appName = this.appName;
113-
this.modules = this.modulesConfig.modules || {};
114-
this.modules[this.appName] = this.appPath;
115-
this.modulesAsJSON = JSON.stringify(this.modules);
116112
cb();
117113
}
118114
}.bind(this));
115+
} else {
116+
this.resolveModule(this.appName);
119117
}
120118
};
121119

route/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ Generator.prototype.rewriteAppJs = function () {
2424
var config = {
2525
file: path.join(
2626
this.appName,
27-
'scripts/app.' + (coffee ? 'coffee' : 'js')
27+
this.scriptsPath,
28+
'app.' + (coffee ? 'coffee' : 'js')
2829
),
2930
needle: '.otherwise',
3031
splicable: [
31-
" templateUrl: 'views/" + this.name.toLowerCase() + ".html'" + (coffee ? "" : "," ),
32+
" templateUrl: '" + this.viewsPath + "/" + this.name.toLowerCase() + ".html'" + (coffee ? "" : "," ),
3233
" controller: '" + this.classedName + "Ctrl'"
3334
]
3435
};

0 commit comments

Comments
 (0)