angular-localization
angular-localization copied to clipboard
Doesn't work with latest version of angular sanitize
I'm using angular-localize#1.2.1 with angular#1.2.28. The bower.json dependencies is as follows:
"dependencies": {
"angular": ">=1.2 < 2",
"angular-cookies": ">=1.2 < 2",
"angular-sanitize": ">=1.2 < 2"
}
This lead to the library not working recently because it installed angular-sanitize#1.6.3, which depends on angular 1.6. I get the following error from it.
TypeError: undefined is not a constructor (evaluating 'angular.module('ngSanitize', [])
.provider('$sanitize', $SanitizeProvider)
.info({ angularVersion: '1.6.3' })')
at [sic]/bower_components/angular-sanitize/angular-sanitize.js:557
I think this will break for everyone not using angular 1.6, as info()
was only added to angular.module
in 1.6.
A workaround is to add "angular-santize": "~1.2"
to my bower.json
, which forces the right version.
Had to do the same thing with angular-cookies. Locked both of them in my bower.json:
"angular-sanitize": "1.6.2",
"angular-cookies": "1.6.2",
Seems it will affect anyone running ng < 1.6.3/latest.
Or you may simply switch to the latest version of Angular-Localization v1.6 which do support the latest angularJS, angular-sanitize and angular-cookies. you can download it from here : https://drive.google.com/file/d/0B6ppbyCzTs4tOUpPSUhWYTZTVmc/view?usp=sharing