How to access files from data folder in angular 2 folder?

I have image and style sheet files inside the resource folder in an angular 2 application, but how do I access these files and images in the main index.html file?

+7
angular
source share
2 answers

You must put your files and use the relative path from the resource folder.

For example, if I put the css file in src/assets/css/myfile.css , then I have to access it like this:

<link rel="stylesheet" href="assets/css/myfile.css">

+14
source share

This is a step back / application. So, if you are inside the application /components/page/page.css, refer to the url (../../../assets/images/logo.png)

0
source share

All Articles