Angular
Angular
Angular
Topics: -
1. Angular Introduction.
2. Angular Setup.
3. Angular Project Creation through CLI.
4. Going through angular project files.
5. Commands for running and build angular application.
6. Angular CLI Commands
Create Component
Create Pipe
Create Directive
Create Module
Create Service
7. Integrate bootstrap with angular.
Angular Setup
https://code.visualstudio.com/download
2) NodeJS
All NodeJS versions do not compatible to the angular, please follow the below link to find the
angular version compatible NodeJS version.
https://stackoverflow.com/questions/60248452/is-there-a-compatibility-list-for-angular-
angular-cli-and-node-js
3) Angular CLI
For installing the angular CLI, we must run the following command
npm i -g @angular/cli
Suppose if we want to install specific version of CLI then use the following command
npm i -g @angular/cli@version – here version will be replaced with number, if we are not
define the version then it defaults take as latest.
Once CLI installed successfully then use following command for confirmation
ng version
ng new <projectname>
** Angular project should not allow the space between the project names. instead of that we
can use “underscore” or “dash”
Main.ts :- The main entry point for the application. This file contains the code to bootstrap the
application root module (AppModule)
Styles.css:- This file contains the global styles of our application. Styles that are local and specific
to a component are often defined with in the component itself for easier maintenance.
Index.html:- The main HTML page that is served when someone visits your site.
The ng build command is intentionally for building the apps and deploying the build artifacts.
The ng serve command is intentionally for fast, local, and iterative developments and also for builds,
watches and serves the application from a local CLI development server.
The main difference is – The ng build command writes generated build artifacts to the output folder
and the ng serve command does not. By default, the output folder is - dist/.
We have one more command called ng build –watch. command will regenerate output files when
source files change.
for running test cases we use the ng test command. In angular test files are define with spec
extension.
Polyfills in angular are few lines of code which make your application compatible for different
browsers. The code we write is mostly in ES6(New Features: Overview and Comparison) and is not
compatible with IE or firefox and needs some environment setups before being able to be viewed or
used in these browsers.
https://www.npmjs.com/package/bootstrap
once installed successfully then add it into angular.json file styles array or import in styles.css