After scouring numerous resources, I couldn't find a resolution to my issue.
For your information, I am utilizing ASP.net Core 2.0's default angular project
In the process of developing an Angular application, I am faced with the challenge of loading a customer's logo based on an external configuration.
The file needs to be loaded into my home.component.html
To tackle this, I created a "CustomerService" with a getLogo() function that returns the path to the customer's logo.
Here is the folder structure:
FOLDER STRUCTURE IMAGE
The assets directory houses the images, and the HTML snippet below resides in home.component.html
Since using "../../"" hasn't proven effective, my initial query revolves around finding a workaround.
I've structured the HTML as follows:
<img src="../../assets/timeblockr-logo.png" />
<img [src]="customerservice.getLogo()" />
This is what the CustomerService's getLogo function returns:
getLogo() {
return "../../assets/timeblockr-logo.png";
}
** UPDATE: SUCCESSFULLY RESOLVED!! **
It turns out that I needed to use:
getLogo(): string{
return require("../assets/timeblockr-logo.png");
}
A big thank you to @Niladri for providing the solution to this particular issue!