This application serves as a demo for the usage of Angular Signals as a State Management Solution.
Name | Version |
---|---|
Angular CLI | 18.2.3 |
Node | 20.14.0 |
npm | 10.7.0 |
TypeScript | 5.4.2 |
Git Bash (Windows) | 5.2.26 |
For generating this application the following command was used:
ng new signal-client --skip-git --standalone --strict --routing=true --prefix app --style scss --inline-template false --inline-style false --directory ./
Click here for more info about these flags.
Run npm run start:dev
for a dev server. Navigate to http://localhost:4200
.
The application will automatically reload if you change any of the source files.
Run npm run build
or npm run build:dev
to build the project. The build artifacts will be stored
in the dist/
directory.
To ensure proper deployment to production, it's essential to run the npm run prepare:prod
script before deploying your application.
Bash is required for some scripts that Husky uses. To ensure Husky's Git hooks work correctly on Windows, follow these steps:
Download and install Git Bash from the official Git website: Git Downloads
After installing Git Bash:
- In the "Environment Variables" dialog, under "System variables", find the Path variable, select it, and click "Edit...".
- Add the path to Git Bash (
C:\Program Files\Git\bin
by default) to the list of paths. - Restart (optional)
Add C:\Program Files\Git\bin
to Path for both variable types: User and System -
and put it before "%SystemRoot%\system32"
.
If that does not work try changing npm
to npm.cmd
in C:\Program Files\nodejs
.
This Angular project is configured with Prettier as the code formatter and ESLint as the linter to maintain code quality and consistency.
To set up Prettier and ESLint in Visual Studio Code for this project, follow these steps:
- ESLint:
npm run lint
- Prettier:
npm run prettier
- Both ESLint and Prettier:
npm run pretty-lint
- Install the ESLint extension
- Install the Prettier - Code formatter extension
Open your VS Code settings (Ctrl/Cmd + ,), and add or modify the following settings in your settings.json file:
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"eslint.validate": ["typescript"]
}