Styles and Scripts not getting applied on Angular 2 + App

Updated on: September 25, 2019

You have added jQuery, Bootstrap, Font-Awesome or any third-party css and js files into Angular App through styles and scripts in angular.json file, but still you are not able to see the effects on the browser, then possible solution would be:

Solution 1:

Once you have added css and js file path to styles and scripts section in angular.json file, then you need to stop running the application and re-run it. After re-running application, it should apply the script and styles changes on browser.

Solution 2:

If above Solution 1 does not work, then you need to go through your angular.json file again and review it. 

1. Check whether location of "styles" and "scripts" you have added locations are in "build" section and not in "test" section. if you add it in "test" section, then it will not apply it on browser.

2. Check whether path of the scripts and styles are correct, if not otherwise it will give an error while running "ng serve" command.

Above is the sample styles and scripts section of angular.json file which you can refer and add your jQuery, bootstrap, font-awesome styles and scripts.