I have angular 1.6 ES6 code that does this
service.get()
.then((data) => {
console.log('one')
//arbitrary stuff
return service.get()
})
.then((data) => {
console.log('two')
//more stuff
})
.catch((err) => {
//handle err
})
.finally(console.log('finally'))
and I want to get this from the console:
one
two
finally
but what I actually get is:
finally
one
two
How do I get this turned around so my finally doesn't happen until after my promise chain is complete?