duffn duffn - 1 month ago 9
AngularJS Question

AngularJS LocalStorageModule is not available

I'm attempting to get a brand new Ionic project working with angular-local-storage with no luck. I'm somehow referencing angular-local-storage incorrectly, but I don't know how.

https://github.com/grevory/angular-local-storage

ionic start myApp tabs
cd myApp
ionic platform add ios
ionic build ios
bower install angular-local-storage

// app.js
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'LocalStorageModule'])


Then

ionic serve


Error

Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
Error: [$injector:modulerr] Failed to instantiate module LocalStorageModule due to:
Error: [$injector:nomod] Module 'LocalStorageModule' 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.


What simple thing am I missing?

Answer

I'm not familiar with ionic, but it looks to me like you're missing the script.

Are you sure that you have the script included on the page? I'd confirm that bower did indeed install the script where you think it should be and then make sure its actually referenced before this error is thrown.

Comments