从A.P.I请求返回JSON时出错 [英] Error returning JSON from A.P.I request
本文介绍了从A.P.I请求返回JSON时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我开始使用我的第一个angular.js应用。我编写了一个代码来调用西班牙语押韵词典A.P.I.在此代码中,我将JSON响应记录到控制台。但是,当我运行此代码时出错。控制台没有给我特定的错误,但它涉及我的app.js文件
这是API的网站 -
Rhyme Searcher
这是我的app.js文件:
I am beginning my first angular.js app. I have written code to call a spanish rhyming dictionary A.P.I. In this code I log the JSON response to the console. However there is an error when I run this code. The console doesn't give me the specific error but it concerns my app.js file
Here is the website for the A.P.I-
Rhyme Searcher
Here is my app.js file:
var rhymeApp = angular.module('rhymeApp', ['ngResource']);
rhymeApp.controller('rhymeView', function ($scope, $resource) {
$scope.rhymeApi=$resource("http://store.apicultur.com/api/rima/1.0.0/flor/true/0/200/tr ue", {callBack: "JSON_CALLBACK"}, { get: {method: "JSONP"}});
$scope.rhymeResult = $scope.rhymeApi.get();
console.log($scope.rhymeResult);
});
推荐答案
范围,
资源){
scope.rhymeApi =
scope.rhymeApi=
这篇关于从A.P.I请求返回JSON时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文