正在寻找Angular-Dart的解决方案,该解决方案允许从http或websocket获取API json数据。 https://iextrading.com/developer/docs/#websocket,https://iextrading.com/developer/docs/#http-methods或https://www.alphavantage.co/documentation/ 从Newbee到Dart网站;)
import 'package:http/http.dart' as http;
import 'dart:async';
const socket = require('socket.io-client')('https://ws-api.iextrading.com /1.0/tops')
class StockService {
Future<double> getPrice(String symbol) async {
String url = "https://api.iextrading.com/1.0/stock/${symbol}/price";
http.Response response = await http.get(url);
test('Intraday', () async {
final timeSeries = new TimeSeries("YourAlphaVantageAPIKey");
JSONObject json = await timeSeries.getIntraday("MSFT");
// Use get method to search entire json for key for stock
expect(json.get("2. Symbol"), "MSFT");
<table>
<tr ngFor="let price of prices">
<td>{{ quotes.symbol }}</td>
<td>{{ quotes.price }}</td>
</tr>