Setup to Start Angular
URL: - https://nodejs.org/en/
--Check installed Node.js, npm(Node Package Manager) VersionOpen Node.js command prompt=>Type node -v=>Press Enter
Install
TypeScript
URL: - https://www.typescriptlang.org/
Open Node.js command prompt=>Type npm install -g typescript=>Press Enter
--Update TypeScript
Open Node.js command prompt=>Type npm update -g typescript@latest =>Press Enter
Install
Angular CLI
Open Node.js command prompt=>Type npm install -g @angular/cli=>Press Enter
--Check installed Angular CLI version
Open Node.js command prompt=>Type ng v=>Press Enter
Install
Visual Studio Code editor
Setup Done
Basic CLI command to
know
- ng new “Project Name”
- ng g c “Component Name” or ng generate component “Component Name”
- ng g c “Parent Component/Child Component” –-Nested Component
- ng g s “Service Name” or ng generate service “Service Name”
- ng g cl “Class Name” or ng generate class “Class Name”
- ng g m “Module Name” or ng generate module “Module Name”
- ng g p “Pipe Name” or ng g p “Pipe Name”
- ng serve
- ng serve –o or ng serve -open
--o means Open in Browser
Common Decorator
- @NgModule()-to define module
- @Component()-to define component
- @Injectable()-to define services
- @Input() & Output()-to define properties...that send & received data from the DOM
Type of Decorator
- Class Decorator -e.g. @Component and @NgModule
- Property Decorator-for properties inside classes e.g. @Input() & Output()
- Method Decorator-for methods inside classes e.g. @HostListener
- Parameter Decorator-for parameter inside class constructor e.g. @Inject
Type of Directives
- Component
- Structural
- Attributes
Common features
No comments:
Post a Comment