yuu-eguci / angular-experiment

Want to practice angular-cli + SPA + MPA + i18n + import different external css files in each component.
0 stars 0 forks source link

Use external css files for all components #11

Open yuu-eguci opened 4 years ago

yuu-eguci commented 4 years ago

Description

@Avalonalan Question!

How do you use same external css files for all components? For instance assets/common.css.

(2020-02-02)issue

Avalonalan commented 4 years ago

@yuu-eguci

  1. You can include them in each file.
  2. If 1 is not like what you like, you can include all common CSS files in a loader.js and include it on your top page.
yuu-eguci commented 4 years ago

@Avalonalan Thank you.

But what I wanted to ask you is that in which file should I include the 'loader.js' . In index.html? Or in angular.json? Or root component's ts file? Or ...

Avalonalan commented 4 years ago

@yuu-eguci Well, loader.js should be included in index.html or root components.ts. Angular has app-root and this is where those common files should be included.

ic-eguci commented 4 years ago

@Avalonalan Thank you Alan! I will try.