Giter Site home page Giter Site logo

googlearchive / generator-angularfire Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yeoman/generator-angular

191.0 26.0 52.0 1.44 MB

Yeoman generator for AngularFire: Angular + Firebase apps

JavaScript 72.80% CoffeeScript 12.94% HTML 11.52% CSS 2.74%

generator-angularfire's Introduction

Status: Archived

This repository has been archived and is no longer maintained.

status: inactive

AngularFire generator

Yeoman generator for AngularJS + Firebase (and AngularFire) - lets you quickly set up a project with sensible defaults and best practices.

Usage

For step-by-step instructions on using Yeoman and this generator to build a TODO AngularJS application from scratch see this tutorial.

Install yo, grunt, bower, generator-angularfire and generator-karma:

npm install -g generator-angularfire

Make a new directory, and cd into it:

mkdir my-new-project && cd $_

Run yo angularfire, optionally passing an app name:

yo angularfire [app-name]

Run grunt for building and grunt serve for preview

Generators

Available generators:

App

Sets up a new AngularJS + Firebase app, generating all the boilerplate you need to get started. The app generator also optionally installs Firebase authentication and account management, Bootstrap and additional AngularJS modules, such as angular-resource (installed by default).

Example:

yo angularfire

Route

Generates a controller and view, and configures a route in app/scripts/app.js connecting them.

Example:

yo angularfire:route myroute

Produces app/scripts/controllers/myroute.js:

angular.module('myMod').controller('MyrouteCtrl', function ($scope) {
  // ...
});

Produces app/views/myroute.html:

<p>This is the myroute view</p>

Explicitly provide route URI

Example:

yo angularfire:route myRoute --uri=my/route

Produces controller and view as above and adds a route to app/scripts/app.js with URI my/route

Controller

Generates a controller in app/scripts/controllers.

Example:

yo angularfire:controller user

Produces app/scripts/controllers/user.js:

angular.module('myMod').controller('UserCtrl', function ($scope) {
  // ...
});

Directive

Generates a directive in app/scripts/directives.

Example:

yo angularfire:directive myDirective

Produces app/scripts/directives/myDirective.js:

angular.module('myMod').directive('myDirective', function () {
  return {
    template: '<div></div>',
    restrict: 'E',
    link: function postLink(scope, element, attrs) {
      element.text('this is the myDirective directive');
    }
  };
});

Filter

Generates a filter in app/scripts/filters.

Example:

yo angularfire:filter myFilter

Produces app/scripts/filters/myFilter.js:

angular.module('myMod').filter('myFilter', function () {
  return function (input) {
    return 'myFilter filter:' + input;
  };
});

View

Generates an HTML view file in app/views.

Example:

yo angularfire:view user

Produces app/views/user.html:

<p>This is the user view</p>

Service

Generates an AngularJS service.

Example:

yo angularfire:service myService

Produces app/scripts/services/myService.js:

angular.module('myMod').service('myService', function () {
  // ...
});

You can also do yo angularfire:factory, yo angularfire:provider, yo angularfire:value, and yo angularfire:constant for other types of services.

Decorator

Generates an AngularJS service decorator.

Example:

yo angularfire:decorator serviceName

Produces app/scripts/decorators/serviceNameDecorator.js:

angular.module('myMod').config(function ($provide) {
    $provide.decorator('serviceName', function ($delegate) {
      // ...
      return $delegate;
    });
  });

Options

In general, these options can be applied to any generator, though they only affect generators that produce scripts.

CoffeeScript

For generators that output scripts, the --coffee option will output CoffeeScript instead of JavaScript.

For example:

yo angularfire:controller user --coffee

Produces app/scripts/controller/user.coffee:

angular.module('myMod')
  .controller 'UserCtrl', ($scope) ->

A project can mix CoffeScript and JavaScript files.

To output JavaScript files, even if CoffeeScript files exist (the default is to output CoffeeScript files if the generator finds any in the project), use --coffee=false.

Minification Safe

tl;dr: You don't need to write annotated code as the build step will handle it for you.

By default, generators produce unannotated code. Without annotations, AngularJS's DI system will break when minified. Typically, these annotations that make minification safe are added automatically at build-time, after application files are concatenated, but before they are minified. The annotations are important because minified code will rename variables, making it impossible for AngularJS to infer module names based solely on function parameters.

The recommended build process uses ng-annotate, a tool that automatically adds these annotations. However, if you'd rather not use it, you have to add these annotations manually yourself. Why would you do that though? If you find a bug in the annotated code, please file an issue at ng-annotate.

Add to Index

By default, new scripts are added to the index.html file. However, this may not always be suitable. Some use cases:

  • Manually added to the file
  • Auto-added by a 3rd party plugin
  • Using this generator as a subgenerator

To skip adding them to the index, pass in the skip-add argument:

yo angularfire:service serviceName --skip-add

Bower Components

The following packages are always installed by the app generator:

  • angular
  • angular-mocks
  • firebase

The following additional modules are available as components on bower, and installable via bower install:

  • angular-animate
  • angular-aria
  • angular-cookies
  • angular-messages
  • angular-resource
  • angular-sanitize

All of these can be updated with bower update as new versions of AngularJS or Firebase are released.

json3 and es5-shim have been removed as Angular 1.3 has dropped IE8 support and that is the last version that needed these shims. If you still require these, you can include them with: bower install --save json3 es5-shim. wiredep should add them to your index.html file but if not you can manually add them.

Configuration

Yeoman generated projects can be further tweaked according to your needs by modifying project files appropriately.

Output

You can change the app directory by adding a appPath property to bower.json. For instance, if you wanted to easily integrate with Express.js, you could add the following:

{
  "name": "yo-test",
  "version": "0.0.0",
  ...
  "appPath": "public"
}

This will cause Yeoman-generated client-side files to be placed in public.

Note that you can also achieve the same results by adding an --appPath option when starting generator:

yo angularfire [app-name] --appPath=public

Testing

Running grunt test will run the unit tests with karma.

Changelog

Recent changes can be viewed on Github on the Releases Page

License

BSD license

generator-angularfire's People

Contributors

addyosmani avatar artoale avatar broud avatar btford avatar cebor avatar chicoxyzzy avatar cvrebert avatar eddiemonge avatar exromany avatar hemanth avatar ifours avatar iknite avatar katowulf avatar kevva avatar kf8a avatar marcin-wosinek avatar mklabs avatar mwilc0x avatar passy avatar peterblazejewicz avatar rajarju avatar robinboehm avatar samaxes avatar sindresorhus avatar sleeper avatar stephensauceda avatar stevemao avatar tschaub avatar vstirbu avatar wesleycho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-angularfire's Issues

Unit tests for default services we provide

Create test units for:

services/login.js
services/firebase.js
controllers/login.js
services/waitforauth.js
directives/ngcloakauth.js

Create e2e tests for:

views/account.js

  • create user
  • change password
  • change email address

views/login.js

Need IE=edge line in generated index.html?

First time Yeoman user here. I have myself a webdev checklist. On it sits this instruction to myself. Do include IE=edge in the html header, like so:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome" />

It solves giving IE reasons to operate in any version lower than it can operate.

That meta line is not generated in index.html. Is that intentional, or should it be added?

depencendcy issues

$ npm install -g generator-angularfire
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm ERR! peerinvalid The package generator-karma does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants generator-karma@>=0.9.0

npm ERR! System Darwin 13.4.0
npm ERR! command "/Users/username/.nvm/v0.10.33/bin/node" "/Users/username/.nvm/v0.10.33/bin/npm" "install" "-g" "generator-angularfire"
npm ERR! cwd /Users/username
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/username/npm-debug.log
npm ERR! not ok code 0

LESS Support

I know I'll probably start a firestorm, but if it's easy enough, please bring in LESS support.
I honestly think SASS is slow, requires Ruby (which I hate and won't need when building Node/js clients/servers), and has that insanely poorly documented thing people like called Compass.

ng-show-auth / ng-hide-auth do not work on views?

Hi all, this is probably more of a question than issues about the code:

Could anyone give me some hints as to how to use the ng-show-auth in views? i see that it works fine on index.html, but in my other html it simply hides the element (always).

TypeError: undefined is not a function\n at loadProfile

Hello,

Every time i try to change an e-mail adress as a user from the account page, i receive this error:

{"stack":"TypeError: undefined is not a function\n at loadProfile (http://localhost:9000/scripts/controllers/account.js:60:24)\n at http://localhost:9000/scripts/controllers/account.js:36:11\n at wrappedCallback (http://localhost:9000/bower_components/angular/angular.js:11319:81)\n at http://localhost:9000/bower_components/angular/angular.js:11405:26\n at Scope.$eval (http://localhost:9000/bower_components/angular/angular.js:12412:28)\n at Scope.$digest (http://localhost:9000/bower_components/angular/angular.js:12224:31)\n at Scope.$apply (http://localhost:9000/bower_components/angular/angular.js:12516:24)\n at http://localhost:9000/bower_components/angular/angular.js:14023:36\n at completeOutstandingRequest (http://localhost:9000/bower_components/angular/angular.js:4300:10)\n at http://localhost:9000/bower_components/angular/angular.js:4601:7"}

The adress change is working in firebase and the users are correctly destroyed.

I generated a virgin test project with yo angularfire and i have the same problem.

I can't understand where the problem is.

Bootstrap not being installed correctly

After running a vanilla yo angularfire (aside from the package.json issue) bootstrap isn't being installed properly. When I grunt serve, the app fires, but the style is broken.

If I replace the bower-loaded bootstrap <script src> files with bootstrap from their CDN, it works fine.

Correction: Adding <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> to the <head> corrects the issue

AccountCtrl logout not working as a button on nav

Hello,
I have been trying to make a logout button to be on a nav bar and control its showing using ng-show-auth. However, when i click the button after login, it doesn't do anything.

Could someone shed some light on the matter?

my AccountCtrl and LoginCtrl are as in the generated project. My navbar looks like this:

  <div ng-controller="LoginCtrl" class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
    <ul class="nav navbar-nav navbar-right">
      <li>
        <a ng-href="#">Home</a>
      </li>
      <li>
        <button class="btn btn-primary" ng-hide-auth="" ng-click="oauthLogin('facebook')">Facebook</button>
        <button ng-controller="AccountCtrl" ng-show-auth="" role="button" ng-click="logout()" class="btn btn-danger">Log Out</button>
      </li>
    </ul>
    <p ng-show="err" class="bg-danger">{{err}}</p>
  </div><!-- /.navbar-collapse -->
  </nav>

and my index.html reference for nav.html:

    <!-- Add your site or application content here -->
    <div class="container">
      <div class="header" ng-include="'views/nav.html'"></div>

      <div ng-view=""></div>

Thank you so much in advance.

bower.json - looking for it in app folder

Warning: ENOENT, no such file or directory '/Users/user/Documents/angular/firebase-oauth/app/bower.json' Use --force to continue.

i get this message when i run grunt serve / grunt it seems to be looking for the bower.json in the app folder? is this right ? thanks in advance.

Error on Build

I'm getting the following error on build (grunt serve works fine though):

Warning: Running "imagemin:dist" (imagemin) task

Fatal error: Cannot read property 'contents' of undefined

Error installing without bootstrap

Hi guys, get the following when trying to run using Simple login, Sass, NO bootstrap and all the modules I get the following error:

undefined:38
((__t = ( btnDanger )) == null ? '' : __t) +
^
ReferenceError: btnDanger is not defined
at eval (eval at template (/usr/local/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/lodash/dist/lodash.js:6305:22), :38:11)
at Generator.underscore as _engine
at Generator.engine (/usr/local/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/lib/actions/actions.js:303:10)
at Generator.template (/usr/local/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/lib/actions/actions.js:281:15)
at Generator._htmlTpl (/usr/local/lib/node_modules/generator-angularfire/app/index.js:490:8)
at Generator.copyAngularFireFiles (/usr/local/lib/node_modules/generator-angularfire/app/index.js:418:10)
at /usr/local/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/lib/base.js:341:43

Redirect not working correctly on secured routes

When securing a route using the whenAuthenticated method, for example the chat route in the sample app, the redirect isn't triggered immediately after clicking the link in the navigation, while I'm not logged in. However, the redirect works if I go to the chat route using the browser address bar. I was able to solve this problem by replacing the code in my app with the appropriate modules from the angularfire-seed. In particular, I've replaced routes.js, simpleLogin.js and added changeEmail.js.

SyntaxError: bower.json: Unexpected string

Problem

The generator produces an invalid bower.json file when angular-router.js is not selected for inclusion.

Steps to Reproduce

$ npm install generator-angularfire
...
[Yeoman Doctor] Everything looks all right!
...
$ yo angularfire fooapp
...
? Firebase instance (https://<your instance>.firebaseio.com) fooapp
? Use FirebaseSimpleLogin? Yes
? Which providers shall I install? Email/Password
? Would you like to use Sass (with Compass)? Yes
? Would you like to include Bootstrap? Yes
? Would you like to use the Sass version of Bootstrap? Yes
? Which modules would you like to include? angular-animate.js, angular-cookies.js, angular-resource.js, angular-sanitize.js, angular-touch.js
...
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
...
bower                       EMALFORMED Failed to read /Users/tom/dev/fooapp/bower.json

Additional error details:
Unexpected string

undefined:14
    "firebase-simple-login": "1.6.x",
    ^
SyntaxError: Unexpected string
    at Object.parse (native)
    at Generator._injectDependencies (/Users/tom/dev/fooapp/node_modules/generator-angularfire/app/index.js:465:23)
    at /Users/tom/dev/fooapp/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/async/lib/async.js:232:13
    at /Users/tom/dev/fooapp/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/async/lib/async.js:113:21
    at /Users/tom/dev/fooapp/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/async/lib/async.js:24:16
    at /Users/tom/dev/fooapp/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/async/lib/async.js:229:17
    at /Users/tom/dev/fooapp/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/async/lib/async.js:516:34
    at Generator.<anonymous> (/Users/tom/dev/fooapp/node_modules/generator-angularfire/node_modules/yeoman-generator/lib/actions/install.js:43:7)
    at ChildProcess.emit (events.js:117:20)
    at Process.ChildProcess._handle.onexit (child_process.js:810:12)

Workaround

Inspecting the generated bower.json file reveals it is missing a comma:

{
  "name": "fooapp",
  "version": "0.0.0",
  "dependencies": {
    "angular": "1.2.16",
    "json3": "~3.3.1",
    "es5-shim": "~3.1.0",
    "bootstrap-sass-official": "~3.2.0",
    "angular-resource": "1.2.16",
    "angular-cookies": "1.2.16",
    "angular-sanitize": "1.2.16",
    "angular-animate": "1.2.16",
    "angular-touch": "1.2.16"                   <-- missing comma
    "firebase-simple-login": "1.6.x",
    "angularfire": "0.8.x"
  },
  "devDependencies": {
    "angular-mocks": "1.2.16",
    "angular-scenario": "1.2.16",
    "mockfirebase": "0.2.x"
  },
  "appPath": "app"
}

Adding the missing comma fixes the file.

Update 1.0.0

It was actually a lot simpler than I thought, just used the CDN release of 1.0.0 in place of the bower dep, and followed the migration guide to change out the relevant parts of fire base-utils and simple-login

Error "btnDanger" is not defined when not including Bootstrap

Steps:
I entered my firebase instance
I opted to include FirebaseSimpleAuth (email/password and anonymous)
I declined Sass
I declined Bootstrap
I accepted all Angular modules

Error:
undefined:38
((__t = ( btnDanger )) == null ? '' : __t) +
^
ReferenceError: btnDanger is not defined
at eval (eval at template (/usr/local/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/lodash/dist/lodash.js:6305:22), :38:11)
at Generator.underscore as _engine
at Generator.engine (/usr/local/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/lib/actions/actions.js:303:10)
at Generator.template (/usr/local/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/lib/actions/actions.js:281:15)
at Generator._htmlTpl (/usr/local/lib/node_modules/generator-angularfire/app/index.js:490:8)
at Generator.copyAngularFireFiles (/usr/local/lib/node_modules/generator-angularfire/app/index.js:418:10)
at /usr/local/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/lib/base.js:341:43
at /usr/local/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/async/lib/async.js:551:21
at /usr/local/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/async/lib/async.js:227:13
at iterate (/usr/local/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/async/lib/async.js:134:13)

Installing AngularFire 0.8.2

I'm trying to create a new project using this and it seems like when I do:

npm install -g generator-angularfire

The latest version of angularfire that's installed in my project is still 0.6; is there something I can do to upgrade it?

Cannot find module

I installed the 0.8.2 version of generator-angularfire with:

npm install -g generator-angularfire

When I run yo angularfire I get this error:

Error: Cannot find module '../angularfire-config.json'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/lib/node_modules/generator-angularfire/app/index.js:12:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

I'm on yo version 1.2.1

ngMessages is not added to generated bower.json

angular-messages dependency was not added to bower.json although I selected ngMessages module when the generator asked me which modules would I like to include.

I'm using the 9.1-4 version.

Require a generator that is installed

When I try to generate file I have this error message:
You don't seem to have a generator with the name angularfire:common:C:\Users\pret_ppa\AppData\Roaming\npm\node_modules\generator-angularfire\app\index.js installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 30 registered generators run yo with the --help option.

If I run "yo with the --help option" here it is the result and angularfire:common generator is in the list

Available Generators:
angular
common
constant
controller
decorator
directive
factory
filter
main
provider
route
service
value
view
angularfire
common
constant
controller
decorator
directive
factory
filter
main
provider
route
service
value
view
gulp-angularfire

karma

Error: Cannot find module 'coffee-script'

I just installed the generator and created my first app.

After bower install and npm install when I grunt or grunt serve I get this error:

module.js:338
    throw err;
          ^
Error: Cannot find module 'coffee-script'
    at Function.Module._resolveFilename (mo
    at Function.Module._load (module.js:278
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (c:\Users\ryaburn
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (modul
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310
    at Module.require (module.js:365:17)

Any ideas how I can run the app?

P.S. I'm running Windows 7, npm 2.5.1, node 0.12.0, generator-angularfire 0.9.1-4

"test" is not working after new install

Installed angular generator project using yo.

Summary of my selections:
Out of the box I include Bootstrap and some AngularJS recommended modules, AngularFire, and Firebase authentication.
? Firebase instance (https://.firebaseio.com) glowing-torch-8951
? Include Firebase auth and account tools? Yes
? Which providers shall I install? Email/Password, Anonymous, Facebook, Google, Twitter, GitHub
? Would you like to use Sass (with Compass)? Yes
? Would you like to include Bootstrap? Yes
? Would you like to use the Sass version of Bootstrap? Yes
? Which modules would you like to include? angular-animate.js, angular-cookies.js, angular-resource.js, angular-route.js, angular-sanitize.js, angular-touch.js

Resulting Readme says:
# test

This project is generated with [yo angular generator](https://github.com/yeoman/generator-angular)
version 1.0.0.

## Build & development

Run `grunt` for building and `grunt serve` for preview.

## Testing

Running `grunt test` will run the unit tests with karma.

Running tests results in:
Jacks-Mac-mini:test JackHayward$ npm test

> [email protected] test /Users/JackHayward/Documents/Development/firebase/test
> grunt test

Running "clean:server" (clean) task
>> 0 paths cleaned.

Running "wiredep:app" (wiredep) task

Running "wiredep:test" (wiredep) task

Running "wiredep:sass" (wiredep) task

Running "concurrent:test" (concurrent) task
    Warning: Running "compass:dist" (compass) task
    Warning: Command failed: /bin/sh -c compass --version
    /bin/sh: compass: command not found
     Use --force to continue.

    Aborted due to warnings.

Invalid usage of ref.child()

ref.child() accept only one paramter, but code inside controllers uses Ref.child('users', user.uid), instead it should be Ref.child('users').child(user.uid).

Grunt not running from fresh install - needs compass?

I have latest versions of yo, grunt, bower. I installed the two generators angularfire and karma. I ran yo angularfire. I go into project and ran npm install and bower install.

When I run grunt serve I get:

Running "concurrent:server" (concurrent) task
    Warning: Running "compass:server" (compass) task
    Warning: Command failed: /bin/sh -c compass --version
    /bin/sh: compass: command not found
     Use --force to continue.

    Aborted due to warnings.


    Execution Time (2015-11-29 21:10:01 UTC)
    loading tasks    4ms  ▇▇▇▇▇▇▇ 14%
    compass:server  24ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 83%
    Total 29ms Use --force to continue.

        Aborted due to warnings.

Seems to be an issue with being unable to run compass -- shouldn't the dependencies take care of this?

angular is not defined/grunt requires --force

This is the third time I have tried to use this generator. Each time I have the same problems. Angular is not defined and grunt gets this; Error: Cannot find module 'imagemin-pngquant'. Please help!
screen shot 2014-11-04 at 9 23 22 am

Route Generator produces this message ?

I try to generate a route like this

$ yo angularfire:route page1

and i get this error :

/usr/local/lib/node_modules/generator-angularfire/route/index.js:31
  if( this.env.options.afconfig.specialRoutes[name] !== true) {

 TypeError: Cannot read property 'specialRoutes' of undefined

Any hints on where I should search / a hack I could use ?
What could be the culprit ?

A comma is missing at line 7 of bower.json in the compiled package

{
"name": "catalani",
"version": "0.0.0",
"dependencies": {
"angular": "1.3.0",
"json3": "~3.3.1",
"es5-shim": "~3.1.0"
"firebase": "2.1.x",
"angularfire": "0.9.1"
},
"devDependencies": {
"angular-mocks": "1.3.0",
"angular-scenario": "1.3.0",
"mockfirebase": "0.8.x"
},
"appPath": "app"
}

this was my bower.json file and it was throwing error. After a quick check a comma was missing, dunno if it's me only or if there is an easy solution. Just wanted to let you know.

Thanks

Firebase.child failed: Was called with 2 arguments. Expects no more than 1.

When you click the register button, you get an error that 2 arguments were called on firebase.child instead of 1.

When this would occur, the user would be created in Firebase and trying to reregister would generate an error that the email was already taken. Logging in with the credentials and viewing the profile page displays no email address and no username.

I changed Ref.child('users', user.uid) to Ref.child('users').child(user.id) in login.js under the createProfile(user) function and that fixed the issue.

yo angularfire:route auth required option does not seem to work

generator-angularfire 0.8.2-7

I have tried variations of the yo angularfire:route command with options to require auth but it does not seem to catch e.g. yo angularfire:route myroute --auth-required. The router/index.js code suggests this is possible.

var whenMethod = this.env.options.authRequired? 'whenAuthenticated' : 'when';

I expected that --auth-required would be enough but tried all the options below for good measure.

--auth
--auth-required
--authRequired
--auth=true
--auth-required=true
--authRequired=true

Thoughts?

no such file or directory 'app/bower.json' while running grunt

generator-angularfire 0.8.2-7
node 0.10.31
npm 1.4.23

Creating the app seems fine, no obvious errors but when I runt gunt I get an error that app/bower.json does not exist. I took out most of the output, let me know if you need more.

$ yo angularfire mynewapp

...

[email protected] node_modules/grunt-contrib-imagemin
├── [email protected]
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
app/index.html modified.
$ grunt

...

Running "wiredep:app" (wiredep) task
Warning: ENOENT, no such file or directory '/Users/warren/sandbox/atfourty/app/bower.json' Use --force to continue.

Aborted due to warnings.

yo angular:route function error

When the above function is run the result is placed in the wrong location in app.js causing the solution to break with the following result

.when('/test', {
templateUrl: 'views/test.html',
controller: 'TestCtrl'
})
'use strict';

/**

  • @ngdoc overview
  • @name fireTestApp
  • @description
  • fireTestApp

  • Main module of the application.
    */
    angular.module('fireTestApp', [
    'ngAnimate',
    'ngCookies',
    'ngResource',
    'ngRoute',
    'ngSanitize',
    'ngTouch',
    'firebase',
    'firebase.utils',
    'simpleLogin'
    ]);

yo angularfire:route does not add controller or view

generator-angularfire 0.8.2-7

Based on the documentation I expect that running yo angularfire:route newroute would:

  • Add route to routes.js
  • Add route as a dependency to app.js
  • Add new controller
  • Add new view

All I see happening is the update to routes.js. I summarized the output below. Thoughts?

$ mkdir myapp
$ cd myapp
$ yo angularfire myapp

     _-----_
    |       |    .--------------------------.
    |--(o)--|    |    Welcome to Yeoman,    |
   `---------´   |   ladies and gentlemen!  |
    ( _´U`_ )    '--------------------------'
    /___A___\    
     |  ~  |     
   __'.___.'__   
 ´   `  |° ´ Y ` 

...

[email protected] node_modules/grunt-contrib-imagemin
├── [email protected]
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
app/index.html modified.
$ yo angularfire:route newroute
$ cd app/scripts
$ cat routes.js

...

.when('/newroute', {
        templateUrl: 'views/newroute.html',
        controller: 'NewrouteCtrl'
      })
      .otherwise({redirectTo: '/'});
  }])

...

$ cat app.js 
'use strict';

/**
 * @ngdoc overview
 * @name myappApp
 * @description
 * # myappApp
 *
 * Main module of the application.
 */
angular.module('myappApp', [
    'ngAnimate',
    'ngCookies',
    'ngResource',
    'ngRoute',
    'ngSanitize',
    'ngTouch',
    'firebase',
    'firebase.utils',
    'simpleLogin'
  ]);
$ cd controllers
$ ls -al
total 16
drwxr-xr-x 6 user staff  204 Sep  7 21:51 .
drwxr-xr-x 8 user staff  272 Sep  7 21:51 ..
-rw-r--r-- 1 user staff 1644 Sep  7 21:51 account.js
-rw-r--r-- 1 user staff  909 Sep  7 21:51 chat.js
-rw-r--r-- 1 user staff 1167 Sep  7 21:51 login.js
-rw-r--r-- 1 user staff  315 Sep  7 21:51 main.js
$ cd ../../views
$ ls
$ ls -al
total 16
drwxr-xr-x  6 user staff  204 Sep  7 21:51 .
drwxr-xr-x 12 user staff  408 Sep  7 21:51 ..
-rw-r--r--  1 user staff 1969 Sep  7 21:51 account.html
-rw-r--r--  1 user staff  358 Sep  7 21:51 chat.html
-rw-r--r--  1 user staff 1171 Sep  7 21:51 login.html
-rw-r--r--  1 user staff  792 Sep  6 10:34 main.html

crashed on install

Out of the box I include Bootstrap and some AngularJS recommended modules, AngularFire, and Firebase Simple Login.

? Firebase instance (https://<your instance>.firebaseio.com) bitcoinlatte-demo2
? Use FirebaseSimpleLogin? Yes
? Which providers shall I install? Email/Password, Anonymous
? Would you like to use Sass (with Compass)? Yes
? Would you like to include Bootstrap? No
? Which modules would you like to include? angular-animate.js, angular-cookies.js, angular-resource.js, angular-route.js, angular-sanitize.js, angular-touch.js
   create app/styles/main.scss

undefined:38
((__t = ( btnDanger )) == null ? '' : __t) +
          ^
ReferenceError: btnDanger is not defined
    at eval (eval at template (/Users/username/.nvm/v0.10.33/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/lodash/dist/lodash.js:6305:22), <anonymous>:38:11)
    at Generator.underscore [as _engine] (/Users/username/.nvm/v0.10.33/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/lib/util/engines.js:32:30)
    at Generator.engine (/Users/username/.nvm/v0.10.33/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/lib/actions/actions.js:303:10)
    at Generator.template (/Users/username/.nvm/v0.10.33/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/lib/actions/actions.js:281:15)
    at Generator._htmlTpl (/Users/username/.nvm/v0.10.33/lib/node_modules/generator-angularfire/app/index.js:490:8)
    at Generator.copyAngularFireFiles (/Users/username/.nvm/v0.10.33/lib/node_modules/generator-angularfire/app/index.js:418:10)
    at /Users/username/.nvm/v0.10.33/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/lib/base.js:341:43
    at /Users/username/.nvm/v0.10.33/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/async/lib/async.js:551:21
    at /Users/username/.nvm/v0.10.33/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/async/lib/async.js:227:13
    at iterate (/Users/username/.nvm/v0.10.33/lib/node_modules/generator-angularfire/node_modules/yeoman-generator/node_modules/async/lib/async.js:134:13)

Warning: Task "karma" not found. Use --force to continue. Aborted due to warnings.

With the generator I get this this Warning, same as above, and grunt aborts:

Running "newer:jshint:test" (newer) task
No newer files to process.
Warning: Task "karma" not found. Use --force to continue.

Aborted due to warnings.

What can I do to solve this? I'm sorry if that's something obvious, I'm totally new to grunt/node/++.

Out of date

This generator needs to be updated to include Firebase v2.4.2 and AngularFire v1.2.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.