From 6498ec486f01df37496a7ca5674672d6dad198a7 Mon Sep 17 00:00:00 2001 From: katowulf Date: Fri, 19 Dec 2014 15:38:47 -0700 Subject: [PATCH] Fixes #13 - angularfire:route does not add controller or view Fixes #14 - auth required option does not seem to work --- route/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/route/index.js b/route/index.js index 570cf2b02..bb944fd38 100644 --- a/route/index.js +++ b/route/index.js @@ -28,7 +28,7 @@ var Generator = module.exports = function Generator(name, skipFiles) { this.foundWhenForRoute = true; } - if( !skipFiles ) { + if( skipFiles !== true ) { this.hookFor('angularfire:controller'); this.hookFor('angularfire:view'); } @@ -67,7 +67,9 @@ Generator.prototype.rewriteAppJs = function () { ] }; - var whenMethod = this.env.options.authRequired? 'whenAuthenticated' : 'when'; + + var whenMethod = this.env.options.authRequired || this.options['auth-required']? 'whenAuthenticated' : 'when'; + console.log(whenMethod, this.options); if (coffee) { config.splicable.unshift("." + whenMethod + " '/" + this.uri + "',");