URL을 통해 json 데이터를 가져 오는 데 사용하려고하는 다음 코드가 있습니다. 데이터가 채워지지 않습니다. 내가 어디로 잘못 가고 있니? 내가 여러 옵션을 시도했지만 그들 중 누구도 내베이스 코드와 json URL 데이터를 가져올 필요가 있도록 노력하고 있습니다. 내가Angular.js로 json 데이터 가져 오기
var urvirl = angular.module('urvirl', ['ngRoute', 'ngAnimate', 'ngTouch']).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'fragments/homepage.html',
controller: 'homepageController'
}).
when('/security-profile/', {
templateUrl: 'fragments/my-account.html',
controller: 'securityController'
}).
otherwise({
redirectTo: '/'
});
}]);
var urvirl_controllers = angular.module('urvirl.controllers', ['ngRoute']);
urvirl_controllers.
controller('securityController', ['$scope', '$route', '$window',
function ($scope, $route, $window,) {
}]);
에이 코드를 넣어야하고 URL은 여기입니다 보안 컨트롤러는 다음과 같습니다
$http.get('http://ec2-54-68-150-129.us-west-2.compute.amazonaws.com:8080/urvirl-0.0.1-SNAPSHOT/user/5')
는 .. 오류 콘솔을 확인 우리가 전체 그림을 볼 수 있도록 – tymeJV
는 plunkr 또는 동등한를 확인하시기 바랍니다. –