Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit bc53c96

Browse files
committed
Correct DTDefaultOptions.setLanguageSource #356
The issue comes from the fact `ngDestroy` is called before DT is able to fetch the default language JSON.
1 parent 1670b6b commit bc53c96

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

dist/angular-datatables.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,15 @@ function dtDefaultOptions() {
612612
* @returns {DTDefaultOptions} the default option config
613613
*/
614614
function setLanguageSource(sLanguageSource) {
615-
$.extend($.fn.dataTable.defaults, {
616-
oLanguage: {
617-
sUrl: sLanguageSource
615+
// HACK to resolve the language source manually instead of DT
616+
// See https://github.com/l-lin/angular-datatables/issues/356
617+
$.ajax({
618+
dataType: 'json',
619+
url: sLanguageSource,
620+
success: function(json) {
621+
$.extend(true, $.fn.dataTable.defaults, {
622+
oLanguage: json
623+
});
618624
}
619625
});
620626
return options;

0 commit comments

Comments
 (0)