SlideShare a Scribd company logo
Angular
( formerly Angular 4 )
One framework.
Mobile & desktop.
 Introduction of Angular.
 Features of Angular.
 Development environment setup.
 Project setup
 Structure of Angular project.
 How to install packages.
 What is TypeScript .
 How Angular application start.
 Components.
 How to create component.
 Styling component.
 Component selector.
 Databinding
Agenda
• Angular is an open source JavaScript framework that is used to
build single page based web applications.
• Developed by Google
• Release Date - March 2017
• One framework. Mobile & Desktop.
Angular
Cross
Platform
Speed and
Performance
Productivity Development
Features of Angular
Cross Platform
 Angular use modern web platform capabilities to deliver app-like experiences.
 High performance and zero-step installation.
 Build native mobile apps with Ionic Framework, NativeScript, and React Native.
 Create desktop - installed apps across Mac, Windows, and Linux.
Speed and Performance
 Angular turns our templates into code that's highly optimized for today's JavaScript
machines.
 Serve the first view of your application on node.js, .NET, PHP, and other servers for
rendering in just HTML and CSS. .
 Angular apps load quickly with the new Component Router.
Productivity
 Quickly create UI views with simple and powerful template syntax.
 Command line tools:
 Start building fast
 Add components and tests
 Then instantly deploy.
 Get intelligent code completion, instant errors in popular editors and IDEs.
Full Development Story
 Karma for unit tests.
 Protractor makes our scenario tests run faster and in a stable manner.
 Create high-performance, complex choreographies and animation timelines
with very little code through Angular's intuitive API.
Development Environment Setup
https://nodejs.org/en/download/
Node.js
• Node.js is an open-source, cross-platform JavaScript run-time environment for
executing JavaScript code server-side.
• Download latest version i.e. node v6.10.3
Syntax : - node -v
Check node.js version
• This command is used for checking
current installed version of node.
Syntax : - npm -vCheck npm version
• This command is used for checking
current installed version of Node Package
Manager (npm).
Text Editor
• Visual Studio Code, WebStrome , Sublime or any other text editor IDE
Project Setup
Install Angular CLI Angular CLI is command line interface for Angular
 Open node js command prompt in admin mode.
Syntax : - npm install –g <packagename>
F:/Angular4> npm install –g @angular/cli Node.js command prompt
Current working directory
Globally
Package Name
Step 2 Creating project using Angular CLI
Syntax : - ng new <project_name>
F:/Angular4> ng new MyFirstDemoApp Node.js command prompt
Current working directory
Project Name
Step 3 Enter into newly created project folder i.e. MyFirstDemoApp
Step 4 Run application
Syntax : - ng serve
F:/Angular4/MyFirstDemoApp> ng serve
 ng serve command is used for to run application.
Step 5 Open web browser - localhost:4200
Structure of project
NPM is the node package manager, which installs packages
locally into a project, specifically, into the node_modules
folder.
All images, stylesheets, JavaScript or third party libraries reside in
assets
Configuration Files
Root project folder, all components reside is app
folder.
Entry point of application
Installing Packages
npm install command is used for installing packages.
Syntax
npm install <package_name>
Example
F:/Angular4/MyFirstDemoApp> npm install bootsrap
How App Start
main.ts • Main.ts file is entry point of our application.
• Main.ts file bootstrap app.module.ts file
app.module.ts • This file bootstrap our first component i.e
app.component.ts
app.component.ts • This file render app.component.html file.
app.component.html • Final HTML template
TypeScript
 TypeScript is a free and open source programming language.
 It is developed and maintained by Microsoft.
 It is syntactical superset of JavaScript and adds optional static typings and class
based object oriented programming to the language.
Components
A Component consists of the following −
 Components are a logical piece of code for Angular application.
Component
Template Class Metadata
 Template is used to render
the view for the application.
 This contains the HTML that
needs to be rendered in the
application.
 This is like a class defined in any
language such as C#.
 This has the code which is used
to support the view.
 It is defined in TypeScript.
 This has the extra data
defined for the Angular class.
 It is defined with a decorator.
Decorator
Defines the name of the HTML tag.
It holds our HTML template.
The styles option is used to
style a specific component
 Defining a class called
AppComponent.
 The export keyword is used so that
the component can be used in other
modules in the application.
 title is the name of the property.
 The property is given a value of
‘app’.
We are using the import keyword to
import the ‘Component’ decorator
from the angular/core module.
Creating Component
 ng generate command is used for create component.
Syntax
ng generate component <component_name>
or
ng g c <component_name>
Example
F:/Angular4/MyFirstDemoApp>
ng g c server
Component Selector
By Element
Syntax
@Component({
selector: '[selector-name]',
templateUrl: ‘html - template',
styleUrls: [‘stylesheet']
})
Example
@Component({
selector: '[app-root]',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
<div selector_name> </div> <div app-root> </div>
Define by square brackets [ ] in selector name.
By Class
Syntax
@Component({
selector: ‘.selector-name',
templateUrl: ‘html - template',
styleUrls: [‘stylesheet']
})
Example
@Component({
selector: ‘.app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
<div class =“selector-name”>
</div>
<div class=“app-root”> </div>
Define by dot ( . ) in selector name.
Data binding
 Data binding is communication between business logic and views.
Typescript
Code
(Business
Logic)
Template
(HTML)
Data binding = Communication
Output Data
String Interpolation => {{ data }}
Property Binding => [property] = “ data “
String Interpolation Interpolation markup is used to provide data-binding to text and attribute values.
Syntax
export class <class_name>
{
variableName = ‘any string';
}
Example
export class AppComponent
{
title = ‘This is my demo app';
}
<div {{variableName }} >
</div>
<div {{ title }} > </div>
Property Binding
HTML
<button [disabled]="!isActive"
class="btn">ADD</button>
Typescript
export class ClientComponent {
isActive = false;
constructor() {
setTimeout(() =>
{ this.isActive = true; }, 2000); }
ngOnInit() { }
Property binding allow us to bind values to properties of an element to modify their
behavior or appearance. This can include properties such as class, disabled, href or
textContent.
www.cynoteck.com
Contact No: +1-612-800-9092, +918272014440,
+918430155522s
Website : www.cynoteck.com
Email : sales@Cynoteck.com
Contact handles
An Overview of Angular 4

More Related Content

PDF
Free-ebook-rex-black advanced-software-testing
Qualister
 
PDF
Web automation using selenium.ppt
Ana Sarbescu
 
PPTX
Introduction to Selenium Web Driver
Return on Intelligence
 
PDF
Types of software testing
Testbytes
 
PDF
Como criar testes rápidos e robustos com Cypress
Walmyr Lima e Silva Filho
 
PPTX
Robot framework
boriau
 
PPT
.Net Debugging Techniques
Bala Subra
 
PPT
Test Planning
Nivetha Padmanaban
 
Free-ebook-rex-black advanced-software-testing
Qualister
 
Web automation using selenium.ppt
Ana Sarbescu
 
Introduction to Selenium Web Driver
Return on Intelligence
 
Types of software testing
Testbytes
 
Como criar testes rápidos e robustos com Cypress
Walmyr Lima e Silva Filho
 
Robot framework
boriau
 
.Net Debugging Techniques
Bala Subra
 
Test Planning
Nivetha Padmanaban
 

What's hot (20)

PPTX
SonarQube Presentation.pptx
Satwik Bhupathi Raju
 
PPTX
Chapter 6 - Tool Support for Testing
Neeraj Kumar Singh
 
PPTX
Selenium
Batch2016
 
PPTX
Fundamentals of Testing
Code95
 
PDF
[기본과정] 코드 테스트와 커버리지 기본 교육(개념)
SangIn Choung
 
PPT
SonarQube Overview
Ahmed M. Gomaa
 
PPTX
Selenium introduction
Deepak Kumar Digar
 
PPTX
Test Plan Simplicity
Johan Hoberg
 
PDF
Front-End Testing: Demystified
Seth McLaughlin
 
PDF
Selenium Page Object Model Using Page Factory | Selenium Tutorial For Beginne...
Edureka!
 
PPTX
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Tech OneStop
 
PDF
Agile Testing Framework - The Art of Automated Testing
Dimitri Ponomareff
 
PPT
ISTQB / ISEB Foundation Exam Practice -1
Yogindernath Gupta
 
PPTX
Automated testing using Selenium & NUnit
Alfred Jett Grandeza
 
PPTX
Automation - web testing with selenium
Tzirla Rozental
 
PPTX
Selenium with java
Gousalya Ramachandran
 
PPTX
Automation Testing by Selenium Web Driver
Cuelogic Technologies Pvt. Ltd.
 
PPTX
What's new in Android - Google I/O Extended Bangkok 2022
Somkiat Khitwongwattana
 
PDF
The Many Ways to Test Your React App
All Things Open
 
PPTX
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Ankit Prajapati
 
SonarQube Presentation.pptx
Satwik Bhupathi Raju
 
Chapter 6 - Tool Support for Testing
Neeraj Kumar Singh
 
Selenium
Batch2016
 
Fundamentals of Testing
Code95
 
[기본과정] 코드 테스트와 커버리지 기본 교육(개념)
SangIn Choung
 
SonarQube Overview
Ahmed M. Gomaa
 
Selenium introduction
Deepak Kumar Digar
 
Test Plan Simplicity
Johan Hoberg
 
Front-End Testing: Demystified
Seth McLaughlin
 
Selenium Page Object Model Using Page Factory | Selenium Tutorial For Beginne...
Edureka!
 
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Tech OneStop
 
Agile Testing Framework - The Art of Automated Testing
Dimitri Ponomareff
 
ISTQB / ISEB Foundation Exam Practice -1
Yogindernath Gupta
 
Automated testing using Selenium & NUnit
Alfred Jett Grandeza
 
Automation - web testing with selenium
Tzirla Rozental
 
Selenium with java
Gousalya Ramachandran
 
Automation Testing by Selenium Web Driver
Cuelogic Technologies Pvt. Ltd.
 
What's new in Android - Google I/O Extended Bangkok 2022
Somkiat Khitwongwattana
 
The Many Ways to Test Your React App
All Things Open
 
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Ankit Prajapati
 
Ad

Viewers also liked (7)

PDF
Angular 2 On Production
Oleksandr Tryshchenko
 
PDF
Angular 4 - Introdução
Jackson Veroneze
 
PPTX
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
Roman Kharkovski
 
PDF
Angular 4 for Java Developers
Yakov Fain
 
PDF
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Edureka!
 
PDF
Alphorm.com Formation Angular - Les fondamentaux
Alphorm
 
ODP
Introduction to Angular 2
Knoldus Inc.
 
Angular 2 On Production
Oleksandr Tryshchenko
 
Angular 4 - Introdução
Jackson Veroneze
 
WebSphere App Server vs JBoss vs WebLogic vs Tomcat (InterConnect 2016)
Roman Kharkovski
 
Angular 4 for Java Developers
Yakov Fain
 
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Edureka!
 
Alphorm.com Formation Angular - Les fondamentaux
Alphorm
 
Introduction to Angular 2
Knoldus Inc.
 
Ad

Similar to An Overview of Angular 4 (20)

PPTX
Angular4 getting started
TejinderMakkar
 
PPTX
Angular kickstart slideshare
SaleemMalik52
 
PPTX
Angular Framework ppt for beginners and advanced
Preetha Ganapathi
 
PDF
Introduction To Angular 4 - J2I
Nader Debbabi
 
PPTX
Foster - Getting started with Angular
MukundSonaiya1
 
PPTX
Angular 5 presentation for beginners
Imran Qasim
 
PPTX
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
tilejak773
 
PPTX
Angular Basics.pptx
AshokKumar616995
 
PDF
Angular Notes.pdf
sagarpal60
 
PDF
Angular Meetup 1 - Angular Basics and Workshop
Nitin Bhojwani
 
PDF
Angular, the New Angular JS
Kenzan
 
PDF
Angular - Chapter 1 - Introduction
WebStackAcademy
 
PPTX
Angular 4 and TypeScript
Ahmed El-Kady
 
PPTX
Angular Course.pptx
Imdad Ullah
 
PPTX
Angularjs2 presentation
dharisk
 
PPTX
Angular
TejinderMakkar
 
PPTX
Angular 18 course for begineers and experienced
tejaswinimysoola
 
PPT
Angular.ppt
Mytrux1
 
PDF
Exploring Angular 2 - Episode 1
Ahmed Moawad
 
PDF
Say hello world with angular 5
Abhishek Mallick
 
Angular4 getting started
TejinderMakkar
 
Angular kickstart slideshare
SaleemMalik52
 
Angular Framework ppt for beginners and advanced
Preetha Ganapathi
 
Introduction To Angular 4 - J2I
Nader Debbabi
 
Foster - Getting started with Angular
MukundSonaiya1
 
Angular 5 presentation for beginners
Imran Qasim
 
4 Anguadasdfasdasdfasdfsdfasdfaslar (1).pptx
tilejak773
 
Angular Basics.pptx
AshokKumar616995
 
Angular Notes.pdf
sagarpal60
 
Angular Meetup 1 - Angular Basics and Workshop
Nitin Bhojwani
 
Angular, the New Angular JS
Kenzan
 
Angular - Chapter 1 - Introduction
WebStackAcademy
 
Angular 4 and TypeScript
Ahmed El-Kady
 
Angular Course.pptx
Imdad Ullah
 
Angularjs2 presentation
dharisk
 
Angular 18 course for begineers and experienced
tejaswinimysoola
 
Angular.ppt
Mytrux1
 
Exploring Angular 2 - Episode 1
Ahmed Moawad
 
Say hello world with angular 5
Abhishek Mallick
 

More from Cynoteck Technology Solutions Private Limited (20)

PDF
Delivering powerful integrations without code using out-of-the-box Salesforce...
Cynoteck Technology Solutions Private Limited
 
PPTX
Test automation using selenium
Cynoteck Technology Solutions Private Limited
 
PPT
Business process flow enhancement
Cynoteck Technology Solutions Private Limited
 
PPT
Multi Select Option set in Microsoft Dynamics 365
Cynoteck Technology Solutions Private Limited
 
PPTX
Microsoft Dynamics 365 for customer services
Cynoteck Technology Solutions Private Limited
 
PPTX
Configuring AWS with IoT
Cynoteck Technology Solutions Private Limited
 
PPTX
An Overview of Google Assistant
Cynoteck Technology Solutions Private Limited
 
PPTX
Dynamics 365 for financials
Cynoteck Technology Solutions Private Limited
 
PPT
Microsoft Dynamics 365 for Marketing
Cynoteck Technology Solutions Private Limited
 
PPTX
Microsoft Dynamics 365 for sales
Cynoteck Technology Solutions Private Limited
 
PPTX
Microsoft Dynamics 365- field services
Cynoteck Technology Solutions Private Limited
 
PPTX
What is project service automation in dynamics 365
Cynoteck Technology Solutions Private Limited
 
PPTX
An overview of what is dynamics 365
Cynoteck Technology Solutions Private Limited
 
PDF
Here’s, how microsoft social engagement boost lead
Cynoteck Technology Solutions Private Limited
 
Delivering powerful integrations without code using out-of-the-box Salesforce...
Cynoteck Technology Solutions Private Limited
 
Test automation using selenium
Cynoteck Technology Solutions Private Limited
 
Business process flow enhancement
Cynoteck Technology Solutions Private Limited
 
Multi Select Option set in Microsoft Dynamics 365
Cynoteck Technology Solutions Private Limited
 
Microsoft Dynamics 365 for customer services
Cynoteck Technology Solutions Private Limited
 
An Overview of Google Assistant
Cynoteck Technology Solutions Private Limited
 
Dynamics 365 for financials
Cynoteck Technology Solutions Private Limited
 
Microsoft Dynamics 365 for Marketing
Cynoteck Technology Solutions Private Limited
 
Microsoft Dynamics 365 for sales
Cynoteck Technology Solutions Private Limited
 
Microsoft Dynamics 365- field services
Cynoteck Technology Solutions Private Limited
 
What is project service automation in dynamics 365
Cynoteck Technology Solutions Private Limited
 
An overview of what is dynamics 365
Cynoteck Technology Solutions Private Limited
 
Here’s, how microsoft social engagement boost lead
Cynoteck Technology Solutions Private Limited
 

Recently uploaded (20)

PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
PPTX
AIRLINE PRICE API | FLIGHT API COST |
philipnathen82
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PDF
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
PDF
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PPTX
Presentation of Computer CLASS 2 .pptx
darshilchaudhary558
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PDF
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
PPTX
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
PDF
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PDF
A REACT POMODORO TIMER WEB APPLICATION.pdf
Michael624841
 
PPTX
Save Business Costs with CRM Software for Insurance Agents
Insurance Tech Services
 
DOCX
The Future of Smart Factories Why Embedded Analytics Leads the Way
Varsha Nayak
 
PDF
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
PDF
Become an Agentblazer Champion Challenge
Dele Amefo
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
AIRLINE PRICE API | FLIGHT API COST |
philipnathen82
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
Become an Agentblazer Champion Challenge Kickoff
Dele Amefo
 
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
Presentation of Computer CLASS 2 .pptx
darshilchaudhary558
 
oapresentation.pptx
mehatdhavalrajubhai
 
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
A REACT POMODORO TIMER WEB APPLICATION.pdf
Michael624841
 
Save Business Costs with CRM Software for Insurance Agents
Insurance Tech Services
 
The Future of Smart Factories Why Embedded Analytics Leads the Way
Varsha Nayak
 
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
Become an Agentblazer Champion Challenge
Dele Amefo
 

An Overview of Angular 4

  • 1. Angular ( formerly Angular 4 ) One framework. Mobile & desktop.
  • 2.  Introduction of Angular.  Features of Angular.  Development environment setup.  Project setup  Structure of Angular project.  How to install packages.  What is TypeScript .  How Angular application start.  Components.  How to create component.  Styling component.  Component selector.  Databinding Agenda
  • 3. • Angular is an open source JavaScript framework that is used to build single page based web applications. • Developed by Google • Release Date - March 2017 • One framework. Mobile & Desktop. Angular
  • 5. Cross Platform  Angular use modern web platform capabilities to deliver app-like experiences.  High performance and zero-step installation.  Build native mobile apps with Ionic Framework, NativeScript, and React Native.  Create desktop - installed apps across Mac, Windows, and Linux.
  • 6. Speed and Performance  Angular turns our templates into code that's highly optimized for today's JavaScript machines.  Serve the first view of your application on node.js, .NET, PHP, and other servers for rendering in just HTML and CSS. .  Angular apps load quickly with the new Component Router.
  • 7. Productivity  Quickly create UI views with simple and powerful template syntax.  Command line tools:  Start building fast  Add components and tests  Then instantly deploy.  Get intelligent code completion, instant errors in popular editors and IDEs.
  • 8. Full Development Story  Karma for unit tests.  Protractor makes our scenario tests run faster and in a stable manner.  Create high-performance, complex choreographies and animation timelines with very little code through Angular's intuitive API.
  • 9. Development Environment Setup https://nodejs.org/en/download/ Node.js • Node.js is an open-source, cross-platform JavaScript run-time environment for executing JavaScript code server-side. • Download latest version i.e. node v6.10.3 Syntax : - node -v Check node.js version • This command is used for checking current installed version of node.
  • 10. Syntax : - npm -vCheck npm version • This command is used for checking current installed version of Node Package Manager (npm). Text Editor • Visual Studio Code, WebStrome , Sublime or any other text editor IDE
  • 11. Project Setup Install Angular CLI Angular CLI is command line interface for Angular  Open node js command prompt in admin mode. Syntax : - npm install –g <packagename> F:/Angular4> npm install –g @angular/cli Node.js command prompt Current working directory Globally Package Name
  • 12. Step 2 Creating project using Angular CLI Syntax : - ng new <project_name> F:/Angular4> ng new MyFirstDemoApp Node.js command prompt Current working directory Project Name
  • 13. Step 3 Enter into newly created project folder i.e. MyFirstDemoApp Step 4 Run application Syntax : - ng serve F:/Angular4/MyFirstDemoApp> ng serve  ng serve command is used for to run application.
  • 14. Step 5 Open web browser - localhost:4200
  • 15. Structure of project NPM is the node package manager, which installs packages locally into a project, specifically, into the node_modules folder. All images, stylesheets, JavaScript or third party libraries reside in assets Configuration Files Root project folder, all components reside is app folder. Entry point of application
  • 16. Installing Packages npm install command is used for installing packages. Syntax npm install <package_name> Example F:/Angular4/MyFirstDemoApp> npm install bootsrap
  • 17. How App Start main.ts • Main.ts file is entry point of our application. • Main.ts file bootstrap app.module.ts file app.module.ts • This file bootstrap our first component i.e app.component.ts app.component.ts • This file render app.component.html file. app.component.html • Final HTML template
  • 18. TypeScript  TypeScript is a free and open source programming language.  It is developed and maintained by Microsoft.  It is syntactical superset of JavaScript and adds optional static typings and class based object oriented programming to the language.
  • 19. Components A Component consists of the following −  Components are a logical piece of code for Angular application. Component Template Class Metadata  Template is used to render the view for the application.  This contains the HTML that needs to be rendered in the application.  This is like a class defined in any language such as C#.  This has the code which is used to support the view.  It is defined in TypeScript.  This has the extra data defined for the Angular class.  It is defined with a decorator.
  • 20. Decorator Defines the name of the HTML tag. It holds our HTML template. The styles option is used to style a specific component  Defining a class called AppComponent.  The export keyword is used so that the component can be used in other modules in the application.  title is the name of the property.  The property is given a value of ‘app’. We are using the import keyword to import the ‘Component’ decorator from the angular/core module.
  • 21. Creating Component  ng generate command is used for create component. Syntax ng generate component <component_name> or ng g c <component_name> Example F:/Angular4/MyFirstDemoApp> ng g c server
  • 22. Component Selector By Element Syntax @Component({ selector: '[selector-name]', templateUrl: ‘html - template', styleUrls: [‘stylesheet'] }) Example @Component({ selector: '[app-root]', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) <div selector_name> </div> <div app-root> </div> Define by square brackets [ ] in selector name.
  • 23. By Class Syntax @Component({ selector: ‘.selector-name', templateUrl: ‘html - template', styleUrls: [‘stylesheet'] }) Example @Component({ selector: ‘.app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) <div class =“selector-name”> </div> <div class=“app-root”> </div> Define by dot ( . ) in selector name.
  • 24. Data binding  Data binding is communication between business logic and views. Typescript Code (Business Logic) Template (HTML) Data binding = Communication Output Data String Interpolation => {{ data }} Property Binding => [property] = “ data “
  • 25. String Interpolation Interpolation markup is used to provide data-binding to text and attribute values. Syntax export class <class_name> { variableName = ‘any string'; } Example export class AppComponent { title = ‘This is my demo app'; } <div {{variableName }} > </div> <div {{ title }} > </div>
  • 26. Property Binding HTML <button [disabled]="!isActive" class="btn">ADD</button> Typescript export class ClientComponent { isActive = false; constructor() { setTimeout(() => { this.isActive = true; }, 2000); } ngOnInit() { } Property binding allow us to bind values to properties of an element to modify their behavior or appearance. This can include properties such as class, disabled, href or textContent.
  • 27. www.cynoteck.com Contact No: +1-612-800-9092, +918272014440, +918430155522s Website : www.cynoteck.com Email : [email protected] Contact handles

Editor's Notes

  • #3: Lesson descriptions should be brief.
  • #4: Example objectives At the end of this lesson, you will be able to: Save files to the team Web server. Move files to different locations on the team Web server. Share files on the team Web server.