AngularJS ngSanitize says "lowercase is not a function"

7k Views Asked by At

My problem: I have to use the ngSanitize module, but when I run the project, I have the following error:

Failed to instantiate module ngSanitize due to: lowercase is not a function.

I've had organized all my .js files, and organize all file versions, but the problem persists. I don't know what to do anymore.

3

There are 3 best solutions below

0
João Rocha On BEST ANSWER

I'd found the error, for a unknown reason my sbt was importing the angular in 1.7.0 version, in this angular version the angular.lowercase was removed. Glad you guys are helpful and friendly! Thanks a lot for the help!

0
Nikhil On

I faced the same issue, npm was installing random version of ng-sanitize, so I removed ^(caret) sign from package.json for all the dependencies then run npm install, It worked fine.

0
Shashi Kiran On

Update to latest version of angular and angular-sanitize. Key is to install same versions of both libraries. If there is mismatch it might cause compatibility issues like lowercase or uppercase methods not found.