Issue
I have an AngularJS project and I am trying to show an image from local folder. My folder hierarchy is like this:
--app(folder)
-----controllers(folder)
-----services(folder)
-----views(folder)
--------images(folder)
-----------image1.jpg
-----------image2.jpg
-----------image3.jpg
--------persons.html
--------departments.html
--index.html
I have in image address in personsController.js
:
$scope.fooImageAddress='images/image1.jpg';
and in person.html
:
<img ng-src="{{ fooImageAddress}}" alt="here should be an image"/>
And nothing shows, just alt
message if img
.
What can I do?
I've read this question, this and this, and tried suggestions, nevertheless there is no result.
Solution
You must change your address, relative to your index.html file
So I suppose app/views/images/image1.jpg
Answered By - Livio Brunner
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.