Skip to content

Commit 4d8464b

Browse files
Jed Maoprotomouse
authored andcommitted
Add conditional references
1 parent 982ecce commit 4d8464b

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

app/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ Generator.prototype.askForModules = function askForModules() {
258258

259259
if (this.cookiesModule) {
260260
angMods.push("'ngCookies'");
261+
this.env.options.ngCookies = true;
261262
}
262263

263264
if (this.messagesModule) {
@@ -266,6 +267,7 @@ Generator.prototype.askForModules = function askForModules() {
266267

267268
if (this.resourceModule) {
268269
angMods.push("'ngResource'");
270+
this.env.options.ngResource = true;
269271
}
270272

271273
if (this.routeModule) {
@@ -275,6 +277,7 @@ Generator.prototype.askForModules = function askForModules() {
275277

276278
if (this.sanitizeModule) {
277279
angMods.push("'ngSanitize'");
280+
this.env.options.ngSanitize = true;
278281
}
279282

280283
if (this.touchModule) {

main/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ util.inherits(Generator, ScriptBase);
1212

1313
Generator.prototype.createAppFile = function createAppFile() {
1414
this.angularModules = this.env.options.angularDeps;
15+
this.ngCookies = this.env.options.ngCookies;
16+
this.ngResource = this.env.options.ngResource;
17+
this.ngSanitize = this.env.options.ngSanitize;
1518
this.ngRoute = this.env.options.ngRoute;
1619
this.appTemplate('app', 'scripts/app');
1720
};

templates/typescript/app.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
/// <reference path="../../bower_components/dt-angular/angular.d.ts" />
2-
<% if (ngRoute) { %>/// <reference path="../../bower_components/dt-angular/angular-route.d.ts" /><% } %>
3-
/// <reference path="../../bower_components/dt-angular/angular-resource.d.ts" />
4-
/// <reference path="../../bower_components/dt-angular/angular-sanitize.d.ts" />
5-
/// <reference path="../../bower_components/dt-angular/angular-resource.d.ts" />
1+
/// <reference path="../../bower_components/dt-angular/angular.d.ts" /><% if (ngCookies) { %>
2+
/// <reference path="../../bower_components/dt-angular/angular-cookies.d.ts" /><% } %><% if (ngResource) { %>
3+
/// <reference path="../../bower_components/dt-angular/angular-resource.d.ts" /><% } %><% if (ngSanitize) { %>
4+
/// <reference path="../../bower_components/dt-angular/angular-sanitize.d.ts" /><% } %><% if (ngRoute) { %>
5+
/// <reference path="../../bower_components/dt-angular/angular-route.d.ts" /><% } %>
66

77
'use strict';
88

0 commit comments

Comments
 (0)