对于那些问原因的人来说,这是因为我可以在我的服务中保证,返回的数据将根据我的文件需要进行处理和调整。。
情景01==我所拥有的==
myFile.ts文件
methodReturnPromise()
.then( data => { /* Sucess, Do This */} )
.catch( err => { /* Failure, Do This Instead */} );
服务.ts
myServiceMethod(): Promise<any> {
methodReturnPromise()
.then( data => { /* Sucess, Treat and return */} )
.catch( err => { /* Failure, Do This Instead and return */} );
}
myFile.ts文件
this.myService.myServiceMethod()
.then( data => { /* Success, Do this */})
.catch( err => { /* Failure, Do This Instead */} );