私はAngularJS
を使用してデータを表示し、ユーザの選択に基づいて画像を表示するページがあります。角度とhtml - リソースの読み込みに失敗しました
サイトは動作しますが、コンソールに、私はこの問題を持っている:
Failed to load resource: the server responded with a status of 404 (Not Found) http://mysite.app/images/places/undefined
これはhtmlです:
<img width="100%" height="100%" ng-src="@{{ selectedEvent.place.image | addFullPathToImage }}" alt="@{{ selectedEvent.place.name }}">
、これは角度コードです:
app.filter('addFullPathToImage', function() {
return function (text) {
return mysite.paths.placesPath + "/" + text;
}
});
イメージは動作しますが、どうすればコンソールエラーを取り除くことができますか?
あなたの 'selectedEvent.place.image'が' undefined'であると書いてあります。実際にイメージ名が含まれていることを確認できますか? – iulian