you must install it directly with the features offered by npm
npm install bootstrap
and attach them to the file angular.json
in the following way (In the section of array
of styles):
"styles": [
"src/styles.scss",
"node_modules/bootstrap/dist/css/bootstrap.min.css",
],
The problem would be that when trying to use all the features offered by Bootstrap
you would make a mess, because you need to use the various supplements of JavaScript
of the library:
Example
In general it is better to avoid using jQuery in an application with
Angular: If the application uses a nav that does not exist in the screen of
login, jQuery / Bootstrap will not add the behavior because it does not
it exists when the "onload" event is launched. Or if an element disappears
of the DOM and then it is generated again, it will lose all behavior
added by jQuery / Bootstrap.
-Pablo Lozano
Or you can install the ng-bootstrap library which is very good because it focuses precisely on being compatible with Angular without the need to use Javascript to execute certain functions. You install it with the following command:
npm install --save @ng-bootstrap/ng-bootstrap
Here is the documentation:
ng-bootstrap