Set angular public style sheets and angular Style Sheets

Source: Internet
Author: User

Set angular public style sheets and angular Style Sheets

I. symptom:

Newly created projects are directly displayed in the src directory. If global styles of other third parties are used, they cannot be managed in one place.

 

Ii. solution:

1. Move the style sheet.

In the assets folder (which usually contains some static files), create a css folder and then paste the external styles.css file (or custom other style sheets, such as common.css) to the css folder;

2. Change the global style path.

(1), open the. angular-cli.json under the root directory to find the style path settings, about 2 rows,

(2) Update the path and set the path of the file previously placed in assets here,

(3) restart the service and run the ng serve command.

 

Iii. Summary:

The same class of things should be managed in a unified place.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.