0
votes

In migrating from beta 31 to rc.1 in my Angular-CLI app, I am now getting some compilation errors, as it pertains to some of my custom icons/images. This is the error I'm getting:

ERROR in ./src/app/ui/nav-menu.component.css Module not found: Error: Can't resolve './app/img/home-icon.svg' in '/Users/mk/Documents/abc/src/app/ui' @ ./src/app/ui/nav-menu.component.css 6:3777-3813 @ ./src/app/ui/nav-menu.component.ts @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

Specifically, what does it indicate when the error states "can't resolve"? Does that imply the item isn't where the app is looking for it? Or something else?

1

1 Answers

1
votes

If you are using angular-cli put static files such as images, fonts etc.. in assets folder and refer them in you HTML files as follows

<img src="assets/sample.jpg" alt="some alt">