angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

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

Open mjeanroy opened this issue 7 years ago • 10 comments

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?

mjeanroy avatar Nov 08 '16 14:11 mjeanroy

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

nmccready avatar Nov 08 '16 14:11 nmccready

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

nmccready avatar Nov 08 '16 15:11 nmccready

Ahh this is not even really cut yet.

nmccready avatar Nov 08 '16 15:11 nmccready

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

mjeanroy avatar Nov 08 '16 15:11 mjeanroy

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

nmccready avatar Nov 08 '16 15:11 nmccready

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

nmccready avatar Nov 08 '16 15:11 nmccready

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

nmccready avatar Nov 08 '16 15:11 nmccready

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

nmccready avatar Nov 08 '16 15:11 nmccready

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

nmccready avatar Nov 08 '16 15:11 nmccready

@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.

mjeanroy avatar Nov 08 '16 15:11 mjeanroy