Bharat
Bharat

Reputation: 6095

Relative path of image not working in angular cli

First of all I am new to Angular, and I have never faced this kind of issue in simple MVC. I am working on it from last 4 hours and still not resolved.

I want to use below marked image in my HTML.

enter image description here

my angularcli.json file looks like this.

enter image description here

and this is how I am accessing the image.

<img src="assets/img/user-medium.png" class="img-circle" alt="Avatar">

any kind of help appreciated.

Upvotes: 0

Views: 935

Answers (1)

Rahul Singh
Rahul Singh

Reputation: 19640

Change your angular-cli.json to

"assets": [
    "assets",
    "favicon.ico"
  ],

and use the following

<img src="/assets/img/user-medium.png" class="img-circle" alt="Avatar">

Upvotes: 3

Related Questions