Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ngSanitize module inject error

I am trying to use angular-sanitize in angularJS.

I require angular-sanitize and inject it in my module.

But i get the following errors:

Uncaught TypeError: f.module(...).provider(...).info is not a function

Uncaught Error: [$injector:modulerr]

app.js

const angular_sanitize = require('angular-sanitize/angular-sanitize.min.js');  

var app = angular
  .module('myApp', ['ngSanitize'])

It works if i am using a script in index.html, but i want it to work as a module dependency instead.

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular-sanitize.min.js"></script>
like image 485
user6086008 Avatar asked Sep 27 '26 19:09

user6086008


1 Answers

Had the same issue, not sure if the same fix but might help.. so.. in bower.json I had "angular-sanitize": "^1.5.5" and on bower install it pulled the latest version 1.6.4 which has breaking changes for my installed angular version 1.5.9.. Try to install the ng-sanitize version that works for your build

like image 184
Teddy Avatar answered Sep 29 '26 13:09

Teddy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!