angular-localization icon indicating copy to clipboard operation
angular-localization copied to clipboard

Doesn't work with latest version of angular sanitize

Open shoebox639 opened this issue 7 years ago • 4 comments

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.

shoebox639 avatar Mar 08 '17 21:03 shoebox639

A workaround is to add "angular-santize": "~1.2" to my bower.json, which forces the right version.

shoebox639 avatar Mar 08 '17 22:03 shoebox639

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.

goody avatar Mar 15 '17 15:03 goody

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

andrewsmalek avatar Mar 31 '17 21:03 andrewsmalek

I have made a fork here It incorporates the latest changes to work with 1.6. It also adds a feature for nested json language files. You can install it via bower using bower install angular-localization-spiria --save Let me know if there are any issues.

Carnid avatar May 10 '17 17:05 Carnid