diff --git a/app/index.js b/app/index.js index 92cfa2713..89d89631d 100644 --- a/app/index.js +++ b/app/index.js @@ -84,6 +84,14 @@ Generator.prototype.askForBootstrap = function askForBootstrap() { type: 'confirm', name: 'compassBootstrap', message: 'Would you like to use the SCSS version of Twitter Bootstrap with the Compass CSS Authoring Framework?', + default: false, + when: function (props) { + return props.bootstrap; + } + }, { + type: 'confirm', + name: 'angularBootstrap', + message: 'Would you like to use Angular directives for Bootstrap?', default: true, when: function (props) { return props.bootstrap; @@ -91,6 +99,8 @@ Generator.prototype.askForBootstrap = function askForBootstrap() { }], function (props) { this.bootstrap = props.bootstrap; this.compassBootstrap = props.compassBootstrap; + this.angularBootstrap = props.angularBootstrap; + this.config.set('angularBootstrap', this.angularBootstrap); cb(); }.bind(this)); @@ -201,6 +211,10 @@ Generator.prototype.extraModules = function extraModules() { modules.push('bower_components/angular-sanitize/angular-sanitize.js'); } + if (this.angularBootstrap) { + modules.push('bower_components/angular-bootstrap/ui-bootstrap.js'); + } + if (modules.length) { this.indexFile = this.appendScripts(this.indexFile, 'scripts/modules.js', modules); diff --git a/templates/common/_bower.json b/templates/common/_bower.json index 20f39a8c6..ecf9ac667 100644 --- a/templates/common/_bower.json +++ b/templates/common/_bower.json @@ -9,7 +9,8 @@ <% } %>"es5-shim": "~2.0.8"<% if (resourceModule) { %>, "angular-resource": "~1.0.7"<% } %><% if (cookiesModule) { %>, "angular-cookies": "~1.0.7"<% } %><% if (sanitizeModule) { %>, - "angular-sanitize": "~1.0.7"<% } %> + "angular-sanitize": "~1.0.7"<% } %><% if (angularBootstrap) { %>, + "angular-bootstrap": "~0.6.0"<% } %> }, "devDependencies": { "angular-mocks": "~1.0.7", diff --git a/templates/common/root/app/favicon.ico b/templates/common/root/app/favicon.ico index 652790530..63e4b6991 100644 Binary files a/templates/common/root/app/favicon.ico and b/templates/common/root/app/favicon.ico differ diff --git a/templates/javascript/app.js b/templates/javascript/app.js index e88ea7922..154cb780e 100644 --- a/templates/javascript/app.js +++ b/templates/javascript/app.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('<%= _.camelize(appname) %>App', []) +angular.module('<%= _.camelize(appname) %>App', [<% if (config.get('angularBootstrap', false)) { %>'ui.bootstrap'<% } %>]) .config(function ($routeProvider) { $routeProvider .when('/', { diff --git a/templates/javascript/spec/controller.js b/templates/javascript/spec/controller.js index 6545c70f2..427630a5b 100644 --- a/templates/javascript/spec/controller.js +++ b/templates/javascript/spec/controller.js @@ -3,7 +3,8 @@ describe('Controller: <%= _.classify(name) %>Ctrl', function () { // load the controller's module - beforeEach(module('<%= _.camelize(appname) %>App')); + beforeEach(module('<%= _.camelize(appname) %>App'));<% if (config.get('angularBootstrap', false)) { %> + beforeEach(module('ui.bootstrap'));<% } %> var <%= _.classify(name) %>Ctrl, scope;