【问题标题】:Issue with AngularJS and financial quoteAngularJS 和财务报价问题
【发布时间】:2014-10-09 20:05:07
【问题描述】:

我的 Angular 请求有问题。

angular.module('google-chart-example', []).controller("MainCtrl", function ($scope,$http,$log) {

    $scope.infos = "";

    //$http.get('http://ip.jsontest.com')
    //$http.get('https://finance.google.com/finance/info?q=TSE:PXT')
    $http.get('http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.quotes where symbol in ("AAPL")&format=json')
    .success(function(data) {
            //alert ("toto");
            $scope.infos = data;

    })
    .error(function(data) {
            alert ("data="+data);
        $scope.infos = data;
    });


});

$http.get('http://ip.jsontest.com') ==>这是一个工作正常..没问题

$http.get('https://finance.google.com/finance/info?q=TSE:PXT') ==> 这个不行,我没有结果

$http.get('http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.quotes where symbol in ("AAPL")&format=json') ==> 这个,我得到了答案,但它告诉我该表不存在: {"error":{"lang":"en-US","description":"找不到表 yahoo.finance.quote 的定义"}} (我试过引用和引用:相同的结果)

知道为什么我无法检索我的价格吗?

我的 HTML:

<html xmlns="http://www.w3.org/1999/html">
<head>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.18/angular.js"</script>
<script src="index3.js"></script>
 </head>
<body ng-app="google-chart-example" ng-controller="MainCtrl">
coucou <br>
{{infos}}
</body>
</html>

【问题讨论】:

    标签: angularjs yahoo-finance


    【解决方案1】:

    您想查询 yahoo.finance.quotes,但是查询需要在 yahoo.finance.quote 上

    select * from yahoo.finance.quote
    

    【讨论】:

      【解决方案2】:
      【解决方案3】:

      对于雅虎,我缺少社区表参数: &env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys

      现在可以了,谢谢。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-01-08
        • 1970-01-01
        • 1970-01-01
        • 2012-06-26
        • 1970-01-01
        • 2016-10-02
        • 1970-01-01
        相关资源
        最近更新 更多