Skip to content

Instantly share code, notes, and snippets.

@ksakae1216
Created October 18, 2016 11:22
Show Gist options
  • Save ksakae1216/925539a3e7d7b8bb225ebd3a152df8be to your computer and use it in GitHub Desktop.
Save ksakae1216/925539a3e7d7b8bb225ebd3a152df8be to your computer and use it in GitHub Desktop.
doAfunc() {
this.$http({
method: 'GET',
url: '/Afunc',
}).success((resul: any, status, headers, config) => {
//HTTP通信の成功
this.$scope.$emit('wait1', result);
}).error((result: any, status, headers, config) => {
//HTTP通信の失敗
});
this.$scope.$on('wait1', () => {
this.doBfunc();
});
}
doBfunc() {
this.$http({
method: 'GET',
url: '/Bfunc',
}).success((result: any, status, headers, config) => {
//HTTP通信の成功
this.$scope.$emit('wait2', result);
}).error((result: any, status, headers, config) => {
//HTTP通信の失敗
});
this.$scope.$on('wait2', () => {
//次に呼びたい関数を記載する
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment