SlideShare une entreprise Scribd logo
1  sur  36
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Agenda
❖ Why we need Angular Directive?
❖ What is Angular Directive?
❖ Types of Angular Directive
❖ Built-in Angular Directives
❖ Working with Custom Angular Directives
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Why We Need Angular Directive?
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Component 1
Component 2
{ }
{ }
Component 4
Component …
Component 3
Component …
{ }
{ }
{ }
{ }
Why we need Directive?
Component 1
Component 2
{ }
{ }
Component 4
Component …
Component 3
Component …
{ }
{ }
{ }
{ }
Changing code for Component 1
Similarly changing code for each components individually…
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Component 1
Component 2
{ }
{ }
Component 4
Component …
Component 3
Component …
{ }
{ }
{ }
{ }
Component 1
Component 2
{ }
{ }
Component 4
Component …
Component 3
Component …
{ }
{ }
{ }
{ }
DirectiveCreate a with required
behavior
Just Import the Directive to all
Components
Directives can be imported anywhere providing similar functionality
Directive
Directive
Directive
Directive
Directive
Directive
Why we need Directive?
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Why we need Directive?
Code modular & manageable
Reusable code
Separating that code out from the view, helps developer to
focus on UI and application logic separately
Available as a stand-alone reusable unit
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
What is Angular Directive?
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Directives Introduction
Directives extend HTML
with new attributes
DOM is transformed according
to directives instructions
Appear within an element tag
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Directives Introduction
Angular provides a set of built-in
directives which offers functionality
Create custom directives
A directive is a class with a
@Directive decorator
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Types of Angular Directive
www.edureka.co/angular-jsEDUREKA ANGULAR-JS CERTIFICATION TRAINING
Types of Angular Directives
Components
1
Structural Directives
2
Attributes Directive
3
Directives with a template
Adds & removes DOM elements to change DOM layout
Changes the appearance or behavior of an element
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Component Directive
@Component decorator is a @Directive decorator
extended with template-oriented features
A component is technically a directive-with-a-template
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Structural Directives
Structural directives alter layout by adding, removing, and replacing elements in DOM.
*ngFor tells Angular to stamp out one
<li> per course in the courses list.
*ngIf includes the CourseDetail
component only if a selected course exists
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Attribute Directives
Attribute Directive alter the appearance or
behavior of an existing element
Displays value property and responds to
changing events
ngModel modifies the behavior of an
existing element
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Built-In Angular Directives
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Built-in Angular Directives
NgStyle
NgIf
NgSwitch
NgFor
NgClass NgClass is used for class binding – adding or
removing several classes
Adding an NgClass property binding sets the
element's classes accordingly
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Built-in Angular Directives
NgStyle
NgIf
NgSwitch
NgFor
NgClass
NgStyle helps in style binding
NgStyle directive is a better choice while
setting many inline styles
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Built-in Angular Directives
NgStyle
NgIf
NgSwitch
NgFor
NgClass
Adds an element subtree to the DOM by
binding an NgIf directive
Binding to a false expression removes the
element subtree from the DOM
VISIBILITY AND NGIF ARE NOT THE SAME
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Built-in Angular Directives
NgStyle
NgIf
NgSwitch
NgFor
NgClass
NgSwitch displays one element from a set of
element trees based on conditions
Returns a switch value
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Built-in Angular Directives
NgStyle
NgIf
NgSwitch
NgFor
NgClass
At any particular moment, at most one of these
spans is in the DOM
3 collaborating directives are at work here:
ngSwitch
1
ngSwitchCase
2
ngSwitchDefault
3
bound to an expression that returns the switch value
bound to an expression returning a match value
a marker attribute on the default element
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Built-in Angular Directives
NgStyle
NgIf
NgSwitch
NgFor
NgClass
NgFor is a repeater directive - presents a list of
items
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
* and template
* modify HTML layout with the help of
templates
NgFor, NgIf, and NgSwitch adds and removes
elements
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Attribute Directive
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Attribute Directive
Directive
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Attribute Directive
provides the functionality of
the @Directive decorator.
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Attribute Directive
It can access the DOM
element
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Attribute Directive
Subscribe to events of the
DOM element
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Attribute Directive
Allows data to flow from the binding
expression into the directive
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Attribute Directive
Contains the directive
metadata in a
configuration object
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Attribute Directive
Identifies the HTML in the template
that is associated with the directive
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Attribute Directive
Directive Class that performs
operation
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Attribute Directive
Grants direct access to the DOM
element through
its nativeElement property
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Attribute Directive
Listens to the event and perform
accordingly
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Custom Structural Directive
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Hands-On
EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js
Thank You …
Questions/Queries/Feedback

Contenu connexe

Tendances

Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - DirectivesWebStackAcademy
 
Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete GuideSam Dias
 
Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced RoutingLaurent Duveau
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data BindingDuy Khanh
 
Angular 10 course_content
Angular 10 course_contentAngular 10 course_content
Angular 10 course_contentNAVEENSAGGAM1
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular ComponentsSquash Apps Pvt Ltd
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questionsGoa App
 
Angular Pipes Workshop
Angular Pipes WorkshopAngular Pipes Workshop
Angular Pipes WorkshopNir Kaufman
 
Angular data binding
Angular data binding Angular data binding
Angular data binding Sultan Ahmed
 
Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Knoldus Inc.
 
RxJS & Angular Reactive Forms @ Codemotion 2019
RxJS & Angular Reactive Forms @ Codemotion 2019RxJS & Angular Reactive Forms @ Codemotion 2019
RxJS & Angular Reactive Forms @ Codemotion 2019Fabio Biondi
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - IntroductionWebStackAcademy
 
Angular 4 The new Http Client Module
Angular 4 The new Http Client ModuleAngular 4 The new Http Client Module
Angular 4 The new Http Client Modulearjun singh
 
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaAngular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaEdureka!
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariSurekha Gadkari
 

Tendances (20)

Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
 
Angular modules in depth
Angular modules in depthAngular modules in depth
Angular modules in depth
 
Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete Guide
 
Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced Routing
 
Angular 9
Angular 9 Angular 9
Angular 9
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
Angular 10 course_content
Angular 10 course_contentAngular 10 course_content
Angular 10 course_content
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular Components
 
Angular
AngularAngular
Angular
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questions
 
Angular Pipes Workshop
Angular Pipes WorkshopAngular Pipes Workshop
Angular Pipes Workshop
 
Angular
AngularAngular
Angular
 
Angular data binding
Angular data binding Angular data binding
Angular data binding
 
Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2
 
RxJS & Angular Reactive Forms @ Codemotion 2019
RxJS & Angular Reactive Forms @ Codemotion 2019RxJS & Angular Reactive Forms @ Codemotion 2019
RxJS & Angular Reactive Forms @ Codemotion 2019
 
Angular overview
Angular overviewAngular overview
Angular overview
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
 
Angular 4 The new Http Client Module
Angular 4 The new Http Client ModuleAngular 4 The new Http Client Module
Angular 4 The new Http Client Module
 
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaAngular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha Gadkari
 

Similaire à Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular Training | Edureka

Angular 4 Directives | Angular 4 Tutorial For Beginners | Angular 4 Directive...
Angular 4 Directives | Angular 4 Tutorial For Beginners | Angular 4 Directive...Angular 4 Directives | Angular 4 Tutorial For Beginners | Angular 4 Directive...
Angular 4 Directives | Angular 4 Tutorial For Beginners | Angular 4 Directive...Edureka!
 
Angular TS(typescript)
Angular TS(typescript)Angular TS(typescript)
Angular TS(typescript)Ivan Stepić
 
Building Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET CoreBuilding Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET CoreLevi Fuller
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2Dor Moshe
 
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...Edureka!
 
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...Edureka!
 
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsAviran Cohen
 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJSInfragistics
 
Custom AngularJS Directives
Custom AngularJS DirectivesCustom AngularJS Directives
Custom AngularJS Directivesyprodev
 
AngularJS Custom Directives
AngularJS Custom DirectivesAngularJS Custom Directives
AngularJS Custom Directivesyprodev
 

Similaire à Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular Training | Edureka (20)

Angular 4 Directives | Angular 4 Tutorial For Beginners | Angular 4 Directive...
Angular 4 Directives | Angular 4 Tutorial For Beginners | Angular 4 Directive...Angular 4 Directives | Angular 4 Tutorial For Beginners | Angular 4 Directive...
Angular 4 Directives | Angular 4 Tutorial For Beginners | Angular 4 Directive...
 
Angular Directive.pptx
Angular Directive.pptxAngular Directive.pptx
Angular Directive.pptx
 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
 
Angular Basics.pptx
Angular Basics.pptxAngular Basics.pptx
Angular Basics.pptx
 
Angular TS(typescript)
Angular TS(typescript)Angular TS(typescript)
Angular TS(typescript)
 
Building Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET CoreBuilding Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET Core
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2
 
Wt unit 5 client &amp; server side framework
Wt unit 5 client &amp; server side frameworkWt unit 5 client &amp; server side framework
Wt unit 5 client &amp; server side framework
 
Ng talk
Ng talkNg talk
Ng talk
 
Angular js-crash-course
Angular js-crash-courseAngular js-crash-course
Angular js-crash-course
 
Angular js 2.0 beta
Angular js 2.0 betaAngular js 2.0 beta
Angular js 2.0 beta
 
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
 
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...
 
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS Fundamentals
 
Directives.pptx
Directives.pptxDirectives.pptx
Directives.pptx
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJS
 
Custom AngularJS Directives
Custom AngularJS DirectivesCustom AngularJS Directives
Custom AngularJS Directives
 
AngularJS Custom Directives
AngularJS Custom DirectivesAngularJS Custom Directives
AngularJS Custom Directives
 
Angular2
Angular2Angular2
Angular2
 

Plus de Edureka!

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaEdureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaEdureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaEdureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaEdureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaEdureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaEdureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaEdureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaEdureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaEdureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaEdureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | EdurekaEdureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEdureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEdureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaEdureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaEdureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaEdureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaEdureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaEdureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | EdurekaEdureka!
 

Plus de Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 

Dernier

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Dernier (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Angular Directives | Angular 2 Custom Directives | Angular Tutorial | Angular Training | Edureka

  • 1.
  • 2. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Agenda ❖ Why we need Angular Directive? ❖ What is Angular Directive? ❖ Types of Angular Directive ❖ Built-in Angular Directives ❖ Working with Custom Angular Directives
  • 3. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Why We Need Angular Directive?
  • 4. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Component 1 Component 2 { } { } Component 4 Component … Component 3 Component … { } { } { } { } Why we need Directive? Component 1 Component 2 { } { } Component 4 Component … Component 3 Component … { } { } { } { } Changing code for Component 1 Similarly changing code for each components individually…
  • 5. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Component 1 Component 2 { } { } Component 4 Component … Component 3 Component … { } { } { } { } Component 1 Component 2 { } { } Component 4 Component … Component 3 Component … { } { } { } { } DirectiveCreate a with required behavior Just Import the Directive to all Components Directives can be imported anywhere providing similar functionality Directive Directive Directive Directive Directive Directive Why we need Directive?
  • 6. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Why we need Directive? Code modular & manageable Reusable code Separating that code out from the view, helps developer to focus on UI and application logic separately Available as a stand-alone reusable unit
  • 7. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js What is Angular Directive?
  • 8. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Directives Introduction Directives extend HTML with new attributes DOM is transformed according to directives instructions Appear within an element tag
  • 9. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Directives Introduction Angular provides a set of built-in directives which offers functionality Create custom directives A directive is a class with a @Directive decorator
  • 10. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Types of Angular Directive
  • 11. www.edureka.co/angular-jsEDUREKA ANGULAR-JS CERTIFICATION TRAINING Types of Angular Directives Components 1 Structural Directives 2 Attributes Directive 3 Directives with a template Adds & removes DOM elements to change DOM layout Changes the appearance or behavior of an element
  • 12. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Component Directive @Component decorator is a @Directive decorator extended with template-oriented features A component is technically a directive-with-a-template
  • 13. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Structural Directives Structural directives alter layout by adding, removing, and replacing elements in DOM. *ngFor tells Angular to stamp out one <li> per course in the courses list. *ngIf includes the CourseDetail component only if a selected course exists
  • 14. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Attribute Directives Attribute Directive alter the appearance or behavior of an existing element Displays value property and responds to changing events ngModel modifies the behavior of an existing element
  • 15. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Built-In Angular Directives
  • 16. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Built-in Angular Directives NgStyle NgIf NgSwitch NgFor NgClass NgClass is used for class binding – adding or removing several classes Adding an NgClass property binding sets the element's classes accordingly
  • 17. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Built-in Angular Directives NgStyle NgIf NgSwitch NgFor NgClass NgStyle helps in style binding NgStyle directive is a better choice while setting many inline styles
  • 18. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Built-in Angular Directives NgStyle NgIf NgSwitch NgFor NgClass Adds an element subtree to the DOM by binding an NgIf directive Binding to a false expression removes the element subtree from the DOM VISIBILITY AND NGIF ARE NOT THE SAME
  • 19. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Built-in Angular Directives NgStyle NgIf NgSwitch NgFor NgClass NgSwitch displays one element from a set of element trees based on conditions Returns a switch value
  • 20. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Built-in Angular Directives NgStyle NgIf NgSwitch NgFor NgClass At any particular moment, at most one of these spans is in the DOM 3 collaborating directives are at work here: ngSwitch 1 ngSwitchCase 2 ngSwitchDefault 3 bound to an expression that returns the switch value bound to an expression returning a match value a marker attribute on the default element
  • 21. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Built-in Angular Directives NgStyle NgIf NgSwitch NgFor NgClass NgFor is a repeater directive - presents a list of items
  • 22. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js * and template * modify HTML layout with the help of templates NgFor, NgIf, and NgSwitch adds and removes elements
  • 23. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Attribute Directive
  • 24. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Attribute Directive Directive
  • 25. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Attribute Directive provides the functionality of the @Directive decorator.
  • 26. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Attribute Directive It can access the DOM element
  • 27. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Attribute Directive Subscribe to events of the DOM element
  • 28. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Attribute Directive Allows data to flow from the binding expression into the directive
  • 29. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Attribute Directive Contains the directive metadata in a configuration object
  • 30. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Attribute Directive Identifies the HTML in the template that is associated with the directive
  • 31. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Attribute Directive Directive Class that performs operation
  • 32. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Attribute Directive Grants direct access to the DOM element through its nativeElement property
  • 33. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Attribute Directive Listens to the event and perform accordingly
  • 34. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Custom Structural Directive
  • 35. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Hands-On
  • 36. EDUREKA ANGULARJS CERTIFICATION TRAINING www.edureka.co/angular-js Thank You … Questions/Queries/Feedback