Reputation: 37
enter image description hereI have some error. this is my code. File html:
<div ng-controller="newsCtrl">
<div class="row">
<div ng-repeat="x in news">
<div class="col-xs-6">
<div class="newsContent">{{x.content}}</div>
<div class="newsImage"><img src="../image/{{x.image}}" alt="vinfast oto"></div>
<div class="newsTitle">
<h2>{{x.title}}</h2>
</div>
</div>
<hr>
</div>
</div>
</div>
File app.js:
app.controller("newsCtrl", function ($scope, $http) {
$http({
method: "GET",
url: "http://localhost:8080/EX11_29112018_spring_restful/news"
}).then(function (response) {
$scope.news = response.data;
})
});
Html in views folder, app.js in js folder, they are in webapp folder. My image is loaded, but I have this error: Failed to load resource: net::ERR_FILE_NOT_FOUND; How to fix it.
Upvotes: 1
Views: 1031