angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

Dependency problems #663

Closed ivailo-stoianov closed 10 years ago

ivailo-stoianov commented 10 years ago

Hello guys, I am having troubles with using NgInfiniteScroll here. If I try to use it in my module I get very cool error in the console, the "Failed to instantiate module myApp due to: [$injector:unpr] Unknown provider: $stateProvider". What's so bad in my code, which is:

angular.module('myApp', ['infinite-scroll'])
.controller

I tried everything I can think of. Sorry about this stupid question but...

DaftMonk commented 10 years ago

You're missing 'ui.router' from your apps module dependencies.

ivailo-stoianov commented 10 years ago

Thanks for your reply! I really hoped that the solution will be so simple, but sadly it's not. :sob: From the good side by adding ui.router I am not getting any errors, but from the bad side my pages are empty. And the funny thing is that if I remove them, everything works.

kingcody commented 10 years ago

if I remove them, everything works

Do you mean if you remove both infinite-scroll and ui.router from your angular module includes that your page loads with content and no errors?

ivailo-stoianov commented 10 years ago

Yep.

kingcody commented 10 years ago

Mind posting your .yo-rc.json and bower.json?

ivailo-stoianov commented 10 years ago

Haven't really touched these except adding the module in bower.json.

.yo-rc.json:

{
  "name": "vcinema",
  "version": "0.0.0",
  "dependencies": {
    "angular": ">=1.2.*",
    "json3": "~3.3.1",
    "es5-shim": "~3.0.1",
    "jquery": "~1.11.0",
    "bootstrap": "~3.1.1",
    "angular-resource": ">=1.2.*",
    "angular-cookies": ">=1.2.*",
    "angular-sanitize": ">=1.2.*",
    "angular-bootstrap": "~0.11.0",
    "font-awesome": ">=4.1.0",
    "lodash": "~2.4.1",
    "angular-socket-io": "~0.6.0",
    "angular-ui-router": "~0.2.10",
    "ngInfiniteScroll": "~1.1.2"
  },
  "devDependencies": {
    "angular-mocks": ">=1.2.*",
    "angular-scenario": ">=1.2.*"
  }
}

And bower.json

    {
  "generator-angular-fullstack": {
    "insertRoutes": true,
    "registerRoutesFile": "server/routes.js",
    "routesNeedle": "// Insert routes below",
    "routesBase": "/api/",
    "pluralizeRoutes": true,
    "insertSockets": true,
    "registerSocketsFile": "server/config/socketio.js",
    "socketsNeedle": "// Insert sockets below",
    "filters": {
      "js": true,
      "html": true,
      "css": true,
      "uirouter": true,
      "bootstrap": true,
      "uibootstrap": true,
      "socketio": true,
      "mongoose": true,
      "auth": true,
      "oauth": true,
      "facebookAuth": true
    }
  },
  "generator-ng-component": {
    "routeDirectory": "client/app/",
    "directiveDirectory": "client/app/",
    "filterDirectory": "client/app/",
    "serviceDirectory": "client/app/",
    "basePath": "client",
    "moduleName": "",
    "filters": [
      "uirouter"
    ],
    "extensions": [
      "js",
      "html",
      "css"
    ],
    "directiveSimpleTemplates": "",
    "directiveComplexTemplates": "",
    "filterTemplates": "",
    "serviceTemplates": "",
    "factoryTemplates": "",
    "controllerTemplates": "",
    "decoratorTemplates": "",
    "providerTemplates": "",
    "routeTemplates": ""
  }
}
kingcody commented 10 years ago

And in client/app/app.js what does your angular.module('app',[...]) declaration look like?

ivailo-stoianov commented 10 years ago

Ow dude, I love you! I didn't add it there. That's my bad. Thanks for the help everyone! :) It's just these little things...

kingcody commented 10 years ago

Haha, not a problem. Glad to hear you have it working now :)

alihalabyah commented 9 years ago

@kingcody Dude you're awesome in 2015 too :)