app.controller('Ctrl', function ($scope, $http) {
$http({method: 'GET', url: "/api/v1/coupons-dunia/coupons-by-website?websiteId=1"}).success(function(data) {
$scope.onlinedata = data.coupons;
$scope.website = data.websites;
});
当我通过www.mydomain.com/cccc/xxxx/
工作正常时,但当我尝试传递/api/v1/coupons-dunia/coupons-by-website?websiteId=1
显示错误时,"SyntaxError: illegal character"
我正在使用AngularJS v1.2.21。
答案 0 :(得分:2)
尝试:
$http({method: 'GET', url: "/api/v1/coupons-dunia/coupons-by-website", params: {websiteId:1})