[英]How to pass methods with pre defined argument to Angular JS Directives
[英]How to pass multiple argument in angular js rest call
嘗試使用$ http.get()方法並在傳遞多個參數的情況下在angular js中強制執行剩余調用,但會引發錯誤
var app = angular.module('angularjs-starter', []);
app.controller('MainCtrl', function ($scope, $http) {
$http.get("https://api.nexmo.com/verify/json?api_key=56a9bn1af&api_secret=d3n0de241&number=919690286358&brand=stayuncle");
});
錯誤是:
org.xml.sax.SAXParseException; lineNumber: 364; columnNumber: 85; The reference to entity "api_secret" must end with the ';' delimiter.
有任何可能的解決方法?
嗨,您可以嘗試以下操作,因為我不在電腦前,所以無法嘗試提出建議。
var obj = {api_key = 56a9bn1af,api_secret = d3n0de241,number = 919690286358,brand =“ stayuncle”};
$ http.get(“ https://api.nexmo.com/verify/json?param= ” + json.stringfy(obj));
通過檢查API,我認為您必須嘗試一下-
"https://api.nexmo.com/verify/json?api_key={api_key}&api_secret={api_secret}&number=447525856424&brand=MyApp"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.