Replace $http.success() by .then()
The $http legacy promise methods success and error have been deprecated in AngularJS 1.5. We must use the standard then method instead.
The $http legacy promise methods success and error have been deprecated in AngularJS 1.5. We must use the standard then method instead.