2017-02-09 4 views
0

こんにちは私は角度とchartjsを使用してデモチャートを構築するためのGoogle publicデータを使用しようとしています。私はコントローラ内でhttpリクエストを作成し、コンソールでフェッチされたデータを表示しようとしましたが、どのデータが利用可能であるかを確認します。しかし、私がエラー$http.get(...).success is not a functionを得ている、それはどういう意味ですか、これを克服してデータを表示する方法です。また、XHR finished loading: GETは何を意味するのですか? 。ありがとう:)パブリックデータを動的データに使用

Link to sample data !!!

myApp.controller('chartController',function($scope,$http){ 
    $http.get("https://www.google.com/publicdata/explore?ds=z8o7pt6rd5uqa6_&ctype=l&strail=false&bcs=d&nselm=h&met_y=unemployment&fdim_y=age_group:y_lt25&fdim_y=seasonality:sa&scale_y=lin&ind_y=false&rdim=country_group&idim=country_group:non-eu&idim=country:de&ifdim=country_group&ind=false&icfg") 
    .success(function(data,response){ 
    console.log(data); 
}) 

答えて

1

あなたが角度1.6+を使用する場合は、.successhas been removed (it has been deprecated since 1.5)。代わりに.thenを使用してください。

$http.get("https://www.google.com/publicdata/explore?ds=z8o7pt6rd5uqa6_&ctype=l&strail=false&bcs=d&nselm=h&met_y=unemployment&fdim_y=age_group:y_lt25&fdim_y=seasonality:sa&scale_y=lin&ind_y=false&rdim=country_group&idim=country_group:non-eu&idim=country:de&ifdim=country_group&ind=false&icfg") 
.then(function(response){ 
    console.log(response.data); 
}) 
関連する問題