でHTTPリクエストをフェッチ/発射されない私は角に新しいですし、下記のHTTP URLを、ディスプレイからデータを取得する必要があり、単純なコードです:AngularJS - すべて
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="galaxyCtrlA">
<p>The $http service requests responses from the the server on the "Zone of Avoidance" galaxies, and the response are set as the values of the "message" and "pictures" variables.</p>
<p>Welcome message from the "Zone of Avoidance" galaxies is:</p>
<h1>{{ message }}</h1>
<p>The pictures from the "Zone of Avoidance" are:</p>
<ul>
<br/>
<li ng-repeat="p in pictures">
<img src="{{ p.image }}" alt="{{ p.image }}" width="60%" />
</li>
</ul>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('galaxyCtrlA', function($scope, $http) {
$http.get("http://www.bogotobogo.com/AngularJS/files/httpRequest/welcome.html")
.then(function(response) {
$scope.message = response.data;
});
$http.get("http://www.bogotobogo.com/AngularJS/files/httpRequest/picture-list.json")
.success(function(response) {
$scope.pictures = response.image;
});
});
</script>
</body>
</html>
上記の出力はかなりあるべきシンプルですが、空白のページが表示されます。エラーはまったくありません。間違った
これはあなたが使っているドメインですか?また、ファイルを見ると、 'response.image'のように見えます。 – casraf
これは私が使っているドメインではありません。その別のドメイン。 – user1411837
これを重複としてマークする前に、私が何を求めているのか、あまりにもスマートに行動しようとするのではなく、出力が同じであるかを理解してください。 @Pankaj Parkar – user1411837