rf2018
rf2018

Reputation: 285

Angular - sharing image between components

I am trying to show the 'app-title-icon' before the Title but the icon does not appear...

https://stackblitz.com/edit/angular-ndwttf

<h1>
  <app-title-icon></app-title-icon>Title
</h1>

Upvotes: 1

Views: 298

Answers (3)

Nilesh Jain
Nilesh Jain

Reputation: 116

There is nothing wrong with the code, the image url has some problem maybe its not returning the required image because when i used some other image url it worked fine.

Upvotes: 1

Krishna Rathore
Krishna Rathore

Reputation: 9687

use correct image path

Stackblitz

.title-icon {
    content: url(https://images.pexels.com/photos/673865/pexels-photo-673865.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260); 
    height: 20px;
    width: 20px;
}

Upvotes: 1

Ali Shahbaz
Ali Shahbaz

Reputation: 845

If you see in console, you're being warned with message request-wrapper.js:229 Cross-Origin Read Blocking (CORB) blocked cross-origin response

try another URL or local URL or exact image URL not site URL

Upvotes: 0

Related Questions