When we build a new Angular application in Visual Studio 2019 we use lots of npm commands to get the resources needed. However because the node_modules folder is not included in the solution, Visual Studio will not pick up the bootstrap CSS for intellisence.
There is a simple fix, but let’s first review how to add Bootstrap to an Angular project in Asp.Net Core 3.
Open a terminal window and point to the ClientApp folder then type:
npm install –save bootstrap
In the node_modules folder you’ll see a new folder called bootstrap:
Open the angular.json and add a reference to the minified bootstrap css:
"styles": [ "node_modules/bootstrap/dist/css/bootstrap.min.css", "src/styles.css" ],
Select the dist folder in the node_modules/bootstrap folder and press ctrl+c to copy it.
Create a new folder called “MyIntellisence” in the root of the solution then paste in the contents of the dist folder:
That’s it! Now when you open a component, Visual Studio will give you gorgeous intellisence: