- Basic knowledge of Angular and TypeScript.
- Node.js and npm installed on your local machine.
- A text editor or integrated development environment (IDE) for editing Angular projects.
- Git installed on your local machine.
- Open a terminal or command prompt and navigate to the directory where you want to create the project.
- Run the command
ng new my-heroes-app --routing --style=scssto create a new Angular project called "my-heroes-app" with a routing module and SCSS styling. - Navigate to the project directory with the command c
d my-heroes-app. - Open the project in your text editor or IDE.
- Run the command
npm install bootstrapto install Bootstrap. - Open the file
angular.jsonin the root of the project. - Add the following code to the
stylesarray:
"styles": [
"src/styles.scss",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
]
- Save the changes to
angular.json.
OR
Another option is to add the following bootstrap cdn link to the index.html file in the <head></head> section:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">This project was generated with Angular CLI version 15.0.4.
Run ng serve for a dev server. Navigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
Run ng build to build the project. The build artifacts will be stored in the dist/ directory.
Run ng test to execute the unit tests via Karma.
Run ng e2e to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.