angular-ui / angular-google-maps

AngularJS directives for the Google Maps Javascript API
http://angular-ui.github.io/angular-google-maps
2.52k stars 1.07k forks source link

Refactor use of methods `success` and `error` of `$http` service #1974

Open mjeanroy opened 8 years ago

mjeanroy commented 8 years ago

Angular 1.6 RC0 has been released and the deprecated success and error callbacks of $http service have been removed. These methods are currently used in angular-google-map (at least here), so it could be great to update the library to use official then callback.

@nmccready I know this library is not actively maintained, but most of projects won't be able to migrate to a new library. Would you be open for a pull request to fix this?

nmccready commented 8 years ago

Sure I will accept the PR and or fix it myself. Then bump and release.

nmccready commented 8 years ago

AngularJS is making this a pain as it seems that they have not cut 1.6 to bower or npm yet.

nmccready commented 8 years ago

Ahh this is not even really cut yet.

mjeanroy commented 8 years ago

@nmccready Thanks for your reply! I'll work on it and submit my PR in the next few days.

nmccready commented 8 years ago

@mjeanroy I am mostly done, but I am having trouble getting the spec to pass with one of the .success removals.

nmccready commented 8 years ago

https://github.com/angular-ui/angular-google-maps/tree/angular_1.6

nmccready commented 8 years ago

nvm I figured out the problem, success callback took care of pulling out the data parameter. So adding .then ({data}) -> fixes it.

nmccready commented 8 years ago

https://github.com/angular-ui/angular-google-maps/commit/11cf3fb134e5f04d8719e85c1c7338ed64ac6489#diff-15112eed26e06263b6f66367bceefbfeR45

nmccready commented 8 years ago

@mjeanroy btw I don't feel comfortable pushing out a release of this until 1.6 is out officially.

mjeanroy commented 8 years ago

@nmccready Awesome, that was fast!

btw I don't feel comfortable pushing out a release of this until 1.6 is out officially.

That makes sense. Even if it is not a small patch, it's probably safer to test it against angularjs 1.6 before releasing it.