AngularJS LocalStorageModule is not available - angularjs

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?

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.

Guy should need to check that have you added link to it's script
src="https://rawgit.com/grevory/angular-local-storage/master/dist/angular-local-storage.min.js"
using <script></script> tag in your index file. It might be the issue. For the guys who will see this in future.

Related

AngularJS Error - Failed to instantiate module ngIdle

I have an Angular app reporting a persistent error.
Failed to instantiate module ngIdle due to ...
Error: $injector:nomod
Module Unavailable
Module 'ngIdle' 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.
After manually adding module via npm install ng-idle, I keep getting the error in my browser. I even see angular idle dir in my node-modules directory.
How do I resolve this?
app.js declaration
var app =angular.module('app', ['ngResource', 'LocalStorageModule', 'ui.router', 'kendo.directives', 'datatables' , 'datatables.bootstrap', 'datatables.scroller', 'angularMoment', 'ngAnimate','ngIdle']);
My index.html was missing the following line
<script src="resources/js/idlejs/angular-idle.js"></script>
Adding the line resolved the error.

Can't add any new Angular Module

In Jhipster v3.9.1,
i tried add module to my projet, but i can't .
For example, i want to add this module http://hakib.github.io/MassAutocomplete/
so i run bower install angular-mass-autocomplete --save
after i run gulp inject:vendor and gulp inject:dep
So the index.html is refreshed now and the module is there 👍
So when i want to use it, i tried to add the .$inject=[] array , it didn't work, i tried use it next to module, it didn't work too ! .module('moduleName', ['mass-autocomplete'])
It gives me always this error :
angular.js:13920 Error: [$injector:unpr] Unknown provider: mass-autocompleteProvider <- mass-autocomplete <- ControllerName
Can't we use a bower module or NPM module ??
Thank you
The first javascript example on linked page shows the injection
var app = angular.module('app', ['ngSanitize', 'MassAutoComplete']);
when in your question you do it like
.module('moduleName', ['mass-autocomplete'])
change 'mass-autocomplete' to 'MassAutoComplete' and it should work - unless you didn't included the JS library in your output JS

Module 'lokijs' is not available

I am new in ionic I want to use offline data storage in my app. for that I use lokiJS in my ionic app.
I used "bower install lokijs --save" for add js.
but when I add lokijs dependency in my app.module like
angular.module('starter', ['ionic', 'lokijs'])
then it show error like below:
Error: [$injector:modulerr] Failed to instantiate module lokijs due to:
Error: [$injector:nomod] Module 'lokijs' is not available! You either misspelled the module name or forgot to load it."
How can I fix this issue?

how to remove dependency error in angular + ionicframwork?

I am try to make simple login page using require js in ionic framwork .But I am getting this error .
Uncaught Error: [$injector:nomod] Module 'app.auth' 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.
http://errors.angularjs.org/1.3.13/$injector/nomod?p0=app.auth
could you please tell me how to remove this error .I am using ionic framwork which is combination of angular and HTML.
here is my code
http://plnkr.co/edit/QPXDMQWDhZumeF5HGvvw?p=preview
define(['ionic','auth/controller/authCtrl'],function(){
'use strict'
angular.module("app.auth",['ionic']);
})

Bug elixir gulp --production angularjs

I working with Laravel 5 and Angularjs, Laravel 5 uses Gulp for schedule asset's task and all work fine when use gulp's command, but when I use gulp --production's command and gulp minimize the Angularjs library, the console's chrome output:
Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:unpr] Unknown provider: e
Below my code:
gulpfile.js
First step, I copy all javascripts from bower folder to assets/js
.copy(
'resources/assets/bower_resources/angular/angular.js',
'resources/assets/js/vendor/angular.js')
.copy(
'resources/assets/bower_resources/angular-bootstrap/ui-bootstrap.js',
'resources/assets/js/vendor/ui-bootstrap.js')
.copy(
'resources/assets/bower_resources/ng-busy/src/angular-busy.js',
'resources/assets/js/vendor/angular-busy.js')
.copy(
'resources/assets/bower_resources/angular-ui-notification/dist/angular-ui-notification.js',
'resources/assets/js/vendor/angular-ui-notification.js')
second step, I put together all libraries copied inside one file "libraries.js"
.scripts(['vendor/angular.js',
'vendor/ui-bootstrap.js',
'vendor/angular-busy.js',
'vendor/angular-ui-notification.js',
'app.js'],'public/scripts/libraries.js')
My app.js
var app = angular.module('app', ['ui.bootstrap','ngBusy','ui-notification']);
app.config(function ($interpolateProvider) {
$interpolateProvider.startSymbol('[[');
$interpolateProvider.endSymbol(']]');
});
I try different combination, but not working.
Please help!
Have you tried using inline annotation for dependency injection?
Here's a previous question that solves this problem
"Uncaught Error: [$injector:unpr]" with angular after deployment

Resources