官术网_书友最值得收藏!

Fetching and persisting data with HTTP – introducing services with Observables

So far, we have gone through a data flow where the component is our view to the outside world, but also the controller. The component uses a service to get the data, but also to persist it. The data, however, has up until this point lived in the service and that's not a very likely place for it to reside. Almost certainly, that data should be fetched and persisted to an endpoint. That endpoint is an exposed URL to a backend system published somewhere on the internet. We can use HTTP to reach said endpoint. Angular has created a wrapper on top of the vanilla way of fetching data through HTTP. The wrapper is a class that wraps the functionality of an object called   XmlHttpRequest. The Angular wrapper class is called the  HttpClient   service.

主站蜘蛛池模板: 澄江县| 黔西县| 宜兰市| 台江县| 新津县| 弥勒县| 高州市| 东至县| 页游| 宜兰县| 明光市| 吕梁市| 台湾省| 华亭县| 衡阳县| 柳河县| 西贡区| 方城县| 北宁市| 都匀市| 沙田区| 错那县| 海城市| 嵊泗县| 镇平县| 保康县| 孝昌县| 蛟河市| 麻江县| 桦南县| 康定县| 勐海县| 揭东县| 江北区| 大渡口区| 桓仁| 辽阳市| 石家庄市| 含山县| 固阳县| 榆林市|