Angular Getting Started
Prerequisites – Knowledge of Typescript,
Basic HTML and CSS
Installation in windows
Prerequisites: Node.js and NPM
Make sure you have node and npm
installed. Below commands should return response
·
node -v
·
npm -v
Command to install angular
npm install -g @angular/cli
Note: if you under corporate proxy you
might have to configure proxy to npm work properly
Verify successful installation and check version
ng
–version
To create project
ng
new <project_name>
example:
ng create my-first-angular-project
To launch Angular application
ng serve
To
launch to different port than default
ng serve
–port 8080
Note: First time ng serve gave me error like ' The serve command requires to be run in an Angular project,
but a project definition could not be found'
Solution: I was not inside the project folder
so move inside the project folder and run the command again and It works. (Funny
😊).
Webpack –
Angular uses webpack build
automation tool. The technique is also known as - HMR - HOT Module replacement / Hot module
reloading. It means you do not need to restart the application for any changes
in the component.
Create a component using angular cli
ng g c <componentName>
ng g c courses
To Create component inside of another component
ng g c Courses/course-details --skipTests
Note-
skipTests can be used if you don’t want to generate test file for the component
Create a service using angular cli
ng g s [serviceName]
continued….
Nice post thanks for uploading this post.
ReplyDeleteFull Stack Training in Chennai | Certification | Online Training Course| Full Stack Training in Bangalore | Certification | Online Training Course | Full Stack Training in Hyderabad | Certification | Online Training Course | Full Stack Developer Training in Chennai | Mean Stack Developer Training in Chennai | Full Stack Training | Certification | Full Stack Online Training Course