我有打印数据在HTML中的问题。我必须从服务器打印数据。AngularJsonp数据打印
这个例子环节
http://mario.com/jsapp/getdata-new.php?jsonp=2017
它的外观:
processData([{"name":"A","open":"0"},{"name":"b","open":"1"}]);
我CTRL
myApp.controller('liveCurrencyCtrl', function ($scope, $http) {
$http.get("http://mario.com/jsapp/getdata-new.php?jsonp=2017")
.then(function (response) {
$scope.names = response.data;
console.log(response.data);
});}
这是我的HTML
<div class="liveCurrencyTable" ng-controller="liveCurrencyCtrl">
<tr ng-repeat="x in names">
{{name}}
</tr>
</div>
你知道我必须做什么吗?当我在HTML中打印所有JSON时,我使用JSON格式,但我必须按元素打印元素。 TNX求助
http.jsonp( “http://mario.com/jsapp/getdata-new.php?jsonp=2017”) ,我有错误:Uncaught ReferenceError:processData没有定义 – mrkibzk
'console.log(response.data);'log?是什么,把它放在qstn中。 – anoop
这是resposne json在链接上的相同形式,我想按元素打印元素: – mrkibzk