# Angular 使用 Observable 和 RxJS 訂好了 Web API 之後,直接使用 Swagger Codegen 產出 Angular Service。 接著在 AppModule 中 import ![在 AppModule 中 import](https://i.imgur.com/rSis9Tg.png) 實際在 Component 中則透過注入,就可以開始使用了。 宣告一個 Observable<> (與 service 的 response 相同型態),就完成 Compnent 的部分!! ![](https://i.imgur.com/VOa5Vro.png) 在 template 的部分 首先建立一個 template 裡面放著 loading 的 Spinner。 接著使用 async pipeline 用 as 接收暫存用的變數跟尚未完成時的loading。 就都完成啦!!! ![都完成啦!!!](https://i.imgur.com/wPLHADI.png)