msfanboy
msfanboy

Reputation: 5291

ngSanitize was removed with bower now I get a ngSanitize Missing Exception

When I installed angularjs with yeoman I got asked to install some additional packages like:

etc...

Now I remove angular-sanitize with:

bower uninstall --save angular-sanitize

When I start my index.hmtl page with

grunt server

Then my browser window is white/empty and the browser console says:

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

1) Now I ask myself WHY can I optionally install an angular plugin which is needed by the core angular.js.

2) How can I fix the mess ? I do not need ngSanitize.

Upvotes: 3

Views: 4637

Answers (1)

Zuriel
Zuriel

Reputation: 1848

When you write angular apps you have the ability to include modules.

angular.module('myApp', [ 'ui.router', 'ngAnimate','ngSanitize']);

when you do not have a dependency loaded.. ie: you uninstall it, you ALSO have to remove it from your application modules or it will throw the error that you have listed. You must remove the 'ngSanitize' as well as the .js file for it to be unloaded.

angular.module('myApp', [ 'ui.router', 'ngAnimate']);

see how now ngSanitize is no longer listed. do a find in your project and locate it and remove it from the modules list.

Upvotes: 2

Related Questions