In the code snippet below, there is an angularJS function named myFunc:
$scope.myFunc = () => {
myModule.getConfig().update(params);
myModule.go();
myModule.log('ok');
};
Additionally, there is a go function defined within the same context:
go: function () {
$state.go('myFunc', options);
},
When executing myModule.go(), which calls an API and takes some time to complete, how can the code be modified to ensure that myModule.log() is only called once the previous operation has finished?