-2
나는 AngularJS와각도 catch되지 않은 구문 에러 : 예기치 않은 토큰 <
angular.module('app').directive('directiveName', function ($http) {
return {
restrict: 'E',
link: function (scope, element, attributes) {
$http({
method: 'JSONP',
url: attributes.resource
}).then(function (response) {
scope.rows = response.data;
console.log(scope.rows);
});
}
};
});
코드를 다음하고는 오류 다음 나에게 돌아 오는 유지합니다.
Uncaught SyntaxError: Unexpected token <
어떻게 해결할 수 있습니까?
응답이 HTML을 반환합니다. 일반적으로 URL이 404 – Ibu
인 경우 일반적으로 발생합니다. – Sajeetharan
과 같이 무작위로 무언가를 선택하려면 해당 URL에서 반환되는 텍스트를 사용합니다. –