This repository was archived by the owner on Feb 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 496
This repository was archived by the owner on Feb 2, 2025. It is now read-only.
withLanguageSource broken with angular 1.6.x #971
Copy link
Copy link
Closed
Description
What versions you are using?
- angular version: 1.6.2
- jquery version: 3.1.1
- datatables version: 1.10.13
- angular-datatables version: 0.6.0
- angular-MM version:
What's the problem?
I'm migrating from angular 1.4.9 to 1.6.2 and angular-datatables from 0.5.5 to 0.6.0.
I've noticed that the localization no longer works.
The language options are now returned in the data property when doing an $http call (see angular docs)
I've narrowed it down to line 98 of angular-datatables.
I've changed
if (options.language && options.language.url) {
var languageDefer = $q.defer();
var languageUrl = options.language.url;
$http.get(options.language.url).then(function(language) {
languageDefer.resolve(language);
}, function() {
$log.error('Could not fetch the content of the language from ' + languageUrl);
});
options.language = languageDefer.promise;
}to
if (options.language && options.language.url) {
var languageDefer = $q.defer();
var languageUrl = options.language.url;
$http.get(options.language.url).then(function(language) {
languageDefer.resolve(language.data); // This line
}, function() {
$log.error('Could not fetch the content of the language from ' + languageUrl);
});
options.language = languageDefer.promise;
}and its working again.
Thesame would be true for line 645, but that line is never called in my application.
function setLanguageSource(sLanguageSource) {
$.ajax({
dataType: 'json',
url: sLanguageSource,
success: function(json) {
$.extend(true, $.fn.DataTable.defaults, {
language: json // Here
});
}
});
return options;
}Can you share your code?
Angular 1.4.9 & angular datatables 0.5.5 - working
Angular 1.6.2 & angular datatables 0.6.0 - broken