Cannot add extra angular dependencies into project with ionic


#1

i’m using the tutorial project that gets created with the ionic start myApp sidemenu command… everything worked just fine… however when I try to add the restangular dependency by doing:

bower.json:

{
  "name": "mySideMenuIonicApp",
  "private": "true",
  "devDependencies": {
    "ionic": "driftyco/ionic-bower#1.0.0-beta.11",
    "restangular": "1.4.0"
  }
}

and

app.js

angular.module('starter', ['ionic', 'starter.controllers','restangular'])

I keep on getting this error:

Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
Error: [$injector:modulerr] Failed to instantiate module restangular due to:
Error: [$injector:nomod] Module 'restangular' is not available! You either misspelled the...<omitted>...1) 

this happened to me with several projects with ionic in it… any idea why? for reference if i run the command ‘bower list’ i get:

├─┬ ionic#1.0.0-beta.11 (latest is 1.0.0-beta.9-nightly-279)
│ ├── angular#1.2.23 (latest is 1.3.0-build.3101+sha.8ac9035)
│ ├─┬ angular-animate#1.2.23 (latest is 1.3.0-build.3101+sha.8ac9035)
│ │ └── angular#1.2.23 (latest is 1.3.0-build.3101+sha.8ac9035)
│ ├─┬ angular-sanitize#1.2.23 (latest is 1.3.0-build.3101+sha.8ac9035)
│ │ └── angular#1.2.23
│ ├─┬ angular-ui-router#0.2.10
│ │ └── angular#1.2.23 (1.3.0-build.3101+sha.8ac9035 available)
│ └── collide#1.0.0-beta.1
└─┬ restangular#1.4.0
  ├── angular#1.2.23 (1.3.0-build.3101+sha.8ac9035 available)
  └── lodash#2.4.1

#2

but i think you have to load external sources in your index.html?


#3

yeah true that… i got it fixed :slight_smile: