Ionic develops an Android app and wants to display a news list, no nonsense, first look at the renderings of the finished product, as shown below:
The data in the list is the interface of Tencent requested, and then displayed on the page, not written dead!
Interface address:
Data requests are made using HttpClient, which is an evolution of the existing Angular HTTP API in a separate @angular/common/http package. This is to ensure that the existing codebase can be slowly migrated to the new API.
Due to the version update of Angular,Http will gradually be replaced by HttpClient, so some methods in Http are not available in HttpClient.
Use HttpClient
app.module.ts You need to add a module reference to it, as follows:
Finally, attach the source code of the individual page
Tourists, if you want to see the hidden content of this post, please Reply
|