Reputation: 602
I must be missing something very basic but I can't get Restangular to load. My steps ...
This is the result ...
Error: [$injector:modulerr] Failed to instantiate module fooApp due to:
Error: [$injector:modulerr] Failed to instantiate module restangular due to:
Error: [$injector:nomod] Module 'restangular' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
Here are my includes ...
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/lodash/dist/lodash.js">
<script src="bower_components/restangular/dist/restangular.js">
Yes, they are in my bower_components directory.
My module definition is ...
angular.module('fooApp', [ 'ngResource', 'restangular' ]);
Any help would be appreciated
Upvotes: 0
Views: 2956
Reputation: 602
Thanks to Marc Kline's help I finally got things working. Here's what I had to do:
yo angular foo
bower install lodash --save
bower install restangular --save
grunt bowerInstall
npm install karma-jasmine --save-dev
npm install karma-chrome-launcher --save-dev
npm install
Upvotes: 1
Reputation: 839
I had a similar issue to this, and the problem was due to the fact that I hasn't added the Lodash and Rectangular JS assets to my Karma test config.
Adding lodash.compat.min.js
and restangular.min.js
to the files array in karma.conf.js
made my tests run correctly.
Upvotes: 0