to install angular cli globally:
npm install -g @angular/cli
to check the version of angular:
ng version
to create new angular application:
ng new <application_name>
inside the application folder:
npm install -g npm
to generate a new component:
ng g c <component_name>
ng g c <component_name> --module <module-name> --skipTest=true
to make the app.module.ts as the main app module file while creating component:
ng g c <component_name> --module app
to create directive:
ng g directive <directive-name>
to generate a new module:
ng g m <module_name>
to create multiple component inside module:
ng g c <module_name>/<component_name>
to create services inside module:
ng g service <module_name>/<service_name>
to create typescript class:
ng g class <class_name>
to create inline styling:
ng g c <component_name> --inline-style
to create inline template:
ng g c <component_name> --inline-template
to create inline style & template together:
ng g c <component_name> --inline-style --inline-template
to add Material-UI:
ng add @angular/material
to add SweetAlert2:
npm install --save sweetalert2
& add the sweetalert2 path in angular.json
file and
"styles": [
"src/styles.css",
"./node_modules/sweetalert2/src/sweetalert2.scss"
],
to add moment (for date manipulation):
npm install moment --save
inside app.component.ts
file:
import * as moment from 'moment';
age18Check(birthday: Date) {
return moment(birthday).add(18, 'years').format('YYYY-MM-DD') <= moment().format('YYYY-MM-DD');
}
to add ngx-datatables
npm i @swimlane/ngx-datatable --save
to add Angular JWT Library
npm i @auth0/angular-jwt --save
to add Route Guard for applying before a route opens or closes
The guard type can be CanActivate
, CanActivateChild
, CanDeactivate
and CanLoad
ng g guard <guard_name>
You can also use:
ng generate directive|pipe|service|class|guard|interface|enum|module
to import content form json file
add the following inside tsconfig.json
file
"allowSyntheticDefaultImports" : true,
"resolveJsonModule" : true,
Run ng build
to build the project. Or run ng build --prod
command & before that set environment.ts
files production = true
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.
Run ng serve
or ng serve --open
for a dev server. Navigate to http://localhost:4200/
. The application will
automatically reload if you change any of the source files.
To get more help on the Angular CLI use ng help
or go check out
the Angular CLI Overview and Command Reference page.
In our angular.json, we should have the budget's keyword.
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
Client: React, Redux, TailwindCSS
Server: Node, Express
To deploy this project run
npm run deploy
MIT License
Copyright (c) [2022] [Abdullah Al Masum]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
If you have any feedback, please reach out to me at abdullahmasum6035@gmail.com