Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

Commit

Permalink
Fixed error with missing module dependency in coffee
Browse files Browse the repository at this point in the history
  • Loading branch information
katowulf committed Sep 4, 2014
1 parent 6c8407c commit 6fea24e
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion angularfire-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"bower": {
"firebase": "1.0.x",
"angularfire": "0.8.x",
"mockfirebase": "0.3.x",
"mockfirebase": "0.2.x",
"simplelogin": "1.6.x"
},

Expand Down
13 changes: 11 additions & 2 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,23 @@ var Generator = module.exports = function Generator(args, options) {

var jsExt = this.options.coffee ? 'coffee' : 'js';

var appFiles = ['app/scripts/**/*.' + jsExt ];
if( this.options.coffee ) {
//todo add these into coffeescript so we don't need this extra step
appFiles.push('app/scripts/angularFire/*.js');
appFiles.push('app/scripts/directives/ngHideAuth.js');
appFiles.push('app/scripts/directives/ngShowAuth.js');
}

this.invoke('karma:app', {
options: {
'skip-install': this.options['skip-install'],
'base-path': '../',
'coffee': this.options.coffee,
'travis': true,
'bower-components': enabledComponents,
'app-files': 'app/scripts/**/*.' + jsExt,
// 'app-files': 'app/scripts/**/*.' + jsExt,
'app-files': appFiles.join(','), //angularfire
'test-files': [
'test/mock/**/*.' + jsExt,
'test/spec/**/*.' + jsExt
Expand Down Expand Up @@ -486,7 +495,7 @@ Generator.prototype._tpl = function(src, dest) {
if( !dest ) { dest = src; }
var suff = this.options.coffee? '.coffee' : '.js';
var destFileName = path.join('scripts', dest+suff);
this.angularFireSourceFiles.push(destFileName);
this.angularFireSourceFiles.push(path.join('scripts', dest+'.js'));
this.template(
// haaaaaack
path.join('..', this.options.coffee? 'coffeescript' : 'javascript', src+suff),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-angularfire",
"version": "0.8.1",
"version": "0.8.2",
"description": "Yeoman generator for Angular+Firebase",
"keywords": [
"yeoman-generator",
Expand Down
10 changes: 1 addition & 9 deletions templates/coffeescript/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,4 @@
# Main module of the application.
###
angular
.module('<%= scriptAppName %>', [<%= angularModules %>])<% if (ngRoute) { %>
.config ($routeProvider) ->
$routeProvider
.when '/',
templateUrl: 'views/main.html'
controller: 'MainCtrl'
.otherwise
redirectTo: '/'
<% } %>
.module('<%= scriptAppName %>', [<%= angularModules %>])
2 changes: 1 addition & 1 deletion templates/coffeescript/filters/reverse.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict"
angular.module("<%= scriptAppName %>").filter "reverse", ->
(items) ->
items.slice().reverse()
if angular.isArray(items) then items.slice().reverse() else []
5 changes: 5 additions & 0 deletions templates/common/app/views/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ <h1>'Allo, 'Allo!</h1>
</div>

<div class="row marketing">
<h4>Firebase</h4>
<p>
Firebase is a powerful API to store and sync data in realtime.
</p>

<h4>HTML5 Boilerplate</h4>
<p>
HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites.
Expand Down
2 changes: 1 addition & 1 deletion templates/common/root/_bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"angular-touch": "<%= ngVer %>"<% } %><% if (routeModule) { %>,
"angular-route": "<%= ngVer %>",
"firebase": "<%= afconfig.bower.firebase %>",<% } %><% if (loginModule) { %>
"firebase-simple-login": "<%= afconfig.bower.simpleLogin %>",<% } %>
"firebase-simple-login": "<%= afconfig.bower.simplelogin %>",<% } %>
"angularfire": "<%= afconfig.bower.angularfire %>"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions templates/javascript/filters/reverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
angular.module('<%= scriptAppName %>')
.filter('reverse', function() {
return function(items) {
return items.slice().reverse();
return angular.isArray(items)? items.slice().reverse() : [];
};
})
});

0 comments on commit 6fea24e

Please sign in to comment.