如何在 ionic 应用程序中显示股票价格的实时变化
我有一个第 3 方 api https://api.twelvedata.com/time_series?symbol=TEST_SYMBOL&interval=1day&apikey=YOUR_API_KEY 我已在卡片中显示股票价格表。现在我必须显示每张卡每秒变化的实时数据我该怎么做。 我尝试了很多方法,但整个 api 都被获取,而不是更新单张卡的数据。
I have a 3rd party api https://api.twelvedata.com/time_series?symbol=TEST_SYMBOL&interval=1day&apikey=YOUR_API_KEY I have displayed stock price list in the cards. Now I have to show the real time data of each card with each sec changes how do i do that.
i have tried many ways but entire api is getting fetched instead of updating data of single card.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,提供的api支持websocket配置。但如果加载了 api,它不会改变价格,我必须刷新浏览器并检查价格变化
Yes, the api provided supports websocket configuration. but if the api is loaded it does not change price i have to refresh the browser and check the price change
您的 API 支持 WebSocket 吗?
什么是 WebSocket?
Websocket 是一种全双工协议,允许客户端和 Web 服务器通过发送和侦听事件进行实时通信。
检查此链接了解更多信息
https://en.wikipedia.org/wiki/WebSocket
带有角度的Websocket< /strong>
https://javascript-conference.com/blog/real-time-in-angular-a-journey-into-websocket-and-rxjs/
Does your API support WebSockets?
What are WebSockets?
Websocket is a full-duplex protocol that allows real-time communication between client and web server through emitting and listening for events.
check this link for more
https://en.wikipedia.org/wiki/WebSocket
Websockets with angular
https://javascript-conference.com/blog/real-time-in-angular-a-journey-into-websocket-and-rxjs/