Angular 7 401 454
Angular 7 401 454
c:\angular\app1\src\styles.css
c:\angular\app1\src\app\app.module.ts
c:\angular\app1\src\app\app.component.ts
c:\angular\app1\src\app\app.component.html
c:\angular\app1\src\app\india\india.component.ts
c:\angular\app1\src\app\india\india.component.html
c:\angular\app1\src\app\Usa\Usa.component.ts
c:\angular\app1\src\app\Usa\Usa.component.html
ng serve
Skip
• It executes the skips the specified no. of data packets, and emits the remaining data packets to the observer.
Skip - Example
Creating Application
• Open Command Prompt and enter the following commands:
cd c:\angular
ng new app1
cd c:\angular\app1
ng g component India
ng g component Usa
ng g service Population
c:\angular\app1\package.json
c:\angular\app1\src\app\population.service.ts
c:\angular\app1\src\styles.css
c:\angular\app1\src\app\app.module.ts
c:\angular\app1\src\app\app.component.ts
c:\angular\app1\src\app\app.component.html
c:\angular\app1\src\app\india\india.component.ts
c:\angular\app1\src\app\india\india.component.html
c:\angular\app1\src\app\Usa\Usa.component.ts
c:\angular\app1\src\app\Usa\Usa.component.html
ng serve
startup.bat
c:\tomcat\webapps\ROOT\WEB-INF\classes\SampleServlet.java
c:\tomcat\webapps\ROOT\WEB-INF\web.xml
Creating Application
• Open Command Prompt and enter the following commands:
cd c:\angular
ng new app1
cd c:\angular\app1
ng g class Employee
ng g service Employees
c:\angular\app1\package.json
c:\angular\app1\src\app\employee.ts
c:\angular\app1\src\app\employees.service.ts
c:\angular\app1\src\app\app.module.ts
c:\angular\app1\src\app\app.component.ts
c:\angular\app1\src\app\app.component.html
cd c:\angular\app1
ng build --prod
ng serve
startup.bat
c:\tomcat\webapps\ROOT\WEB-INF\classes\SampleServlet.java
c:\tomcat\webapps\ROOT\WEB-INF\web.xml
Creating Application
• Open Command Prompt and enter the following commands:
cd c:\angular
ng new app1
cd c:\angular\app1
ng g class Employee
ng g service Employees
c:\angular\app1\package.json
c:\angular\app1\src\app\employee.ts
c:\angular\app1\src\app\employees.service.ts
c:\angular\app1\src\app\app.module.ts
c:\angular\app1\src\app\app.component.ts
c:\angular\app1\src\app\app.component.html
cd c:\angular\app1
ng build --prod
ng serve
http://localhost:8080/index.html
startup.bat
c:\tomcat\webapps\ROOT\WEB-INF\classes\SampleServlet.java
c:\tomcat\webapps\ROOT\WEB-INF\web.xml
Creating Application
• Open Command Prompt and enter the following commands:
cd c:\angular
ng new app1
cd c:\angular\app1
ng g class Employee
ng g service Employees
c:\angular\app1\package.json
c:\angular\app1\src\app\employee.ts
c:\angular\app1\src\app\employees.service.ts
c:\angular\app1\src\app\app.module.ts
c:\angular\app1\src\app\app.component.ts
c:\angular\app1\src\app\app.component.html
cd c:\angular\app1
ng build --prod
ng serve
startup.bat
c:\tomcat\webapps\ROOT\WEB-INF\classes\SampleServlet.java
c:\tomcat\webapps\ROOT\WEB-INF\web.xml
Creating Application
• Open Command Prompt and enter the following commands:
cd c:\angular
ng new app1
cd c:\angular\app1
ng g class Employee
ng g service Employees
c:\angular\app1\package.json
c:\angular\app1\src\app\employee.ts
c:\angular\app1\src\app\employees.service.ts
c:\angular\app1\src\app\app.module.ts
c:\angular\app1\src\app\app.component.ts
c:\angular\app1\src\app\app.component.html
cd c:\angular\app1
ng build --prod
ng serve
Unit Testing
• Unit testing is a process of testing the individual component, whether it is working correctly or not.
• We use “Jasmine” and “Karma” for the unit testing.
• Jasmine: Used to create test cases.
• Protractor: Used to execute the test cases in single browser.
• Karma: Used to execute the test cases in multiple browsers.
Steps
• Command Prompt
cd c:\angular
ng new myapp
cd c:\angular\myapp
c:\angular\myapp\package.json
c:\angular\myapp\src\app\app.component.ts
c:\angular\myapp\src\app\app.component.html
c:\angular\myapp\src\app\app.component.css
c:\angular\myapp\src\app\app.component.spec.ts
c:\angular\myapp\src\app\app.module.ts
c:\angular\myapp\src\styles.css
c:\angular\myapp\src\main.ts
c:\angular\myapp\src\index.html
cd c:\angular\myapp
ng test
http://localhost:9876?id=57394886
Animations
• Animation is a process of changing css property value gradually based on the time limit. That means within
the specified time limit, the property will change from “start value” to “end value”.
• Angular 2+ animations are used to invoke the css animations programmatically through the component.
… …
• Define animation:
Animations - Example
Steps
• Command Prompt
o cd c:\angular
o ng new myapp
o cd c:\angular\myapp
o ng serve
c:\angular\myapp\package.json
c:\angular\myapp\src\app\app.component.ts
c:\angular\myapp\src\app\app.component.html
c:\angular\myapp\src\app\app.component.css
c:\angular\myapp\src\app\app.module.ts
c:\angular\myapp\src\styles.css
c:\angular\myapp\src\main.ts
c:\angular\myapp\src\index.html
cd c:\angular\myapp
ng serve
http://localhost:4200
• "Angular Material Design" provides a set of UI components such as buttons, textboxes, checkboxes, radio
button, dropdownlists, datepicker, menus etc., with rich look and feel.
• It is an alternative to other UI frameworks such as bootstrap and dojo toolkit.
• It provides "Ripple Effect", which is already available in Google Chrome and Android.
2. @angular/cdk
3. @angular/animations
4. hammerjs
1. @angular/material
• This package provides a set of modules which contains angular material design components.
• List of modules:
2. @angular/cdk
3. @angular/animations
4. hammerjs
2. pink-bluegrey.css
3. purple-green.css
4. deeppurple-amber.css
ng new app1
MatButtonModule
• The "MatButtonModule" is used to create buttons.
Syntax: <button mat-button>text here</button>
• Types of Buttons
• Colors of Buttons
MatButtonModule - Example
c:\angular\package.json
c:\angular\src\index.html
c:\angular\src\main.ts
c:\angular\src\app\app.module.ts
c:\angular\scripts\app.ts
c:\angular\AppComponentTemplate.html
cd c:\angular
npm install
tsc
http-server -c-0
http://localhost:8080