I am using Angular JS 1.7 in my project. I am facing an issue with finally clause in the promise:
$http.put(
url,
null,
{
headers: { 'Content-Type': 'application/json' }
}
).then(function (response) {
// success handler
},
function (response) {
// error handler
})
.finally((response) => {
//Do something
})
The code works fine when I remove finally clause but with that clause I am getting:
missing name after . operator
Is that the correct way to use finally clause with Angular 1.7 JS?