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

Angular 1.6.x $http changed - success removed, success is not a function #949

Closed
Orvisky opened this issue Jan 20, 2017 · 1 comment
Closed

Comments

@Orvisky
Copy link

Orvisky commented Jan 20, 2017

What versions you are using?

  • angular version: 1.6.1
  • jquery version: 2.0.2
  • datatables version: 1.10.13
  • angular-datatables version: 0.5.6

What's the problem?

We uprgaded Angular to 1.6.1, and this error showed:

TypeError: $http.get(...).success is not a function

It is in file angular-datatables.js on line 96

// HACK to resolve the language source manually instead of DT
// See https://github.com/l-lin/angular-datatables/issues/181
if (options.language && options.language.url) {
     var languageDefer = $q.defer();
     $http.get(options.language.url).success(function(language) {
          languageDefer.resolve(language);
      });
     options.language = languageDefer.promise;
}

There is BC change in 1.6.x - $http was changed to classic then/catch notation only

Also, there is missing catch(...) part in this piece of code after .success() with languageDefer.reject(). U should put it there too.

Can you share your code?

Not needed


Can you make hotfix ? This can be really fast.

Thank you.

@l-lin
Copy link
Owner

l-lin commented Jan 22, 2017

Fixed in #921.

@l-lin l-lin closed this as completed Jan 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants