(Go: >> BACK << -|- >> HOME <<)

SlideShare a Scribd company logo
iFour ConsultancyAngular Directives
https://www.ifourtechnolab.com/
Index
❏ Introduction
❏ ngIf
❏ ngFor
❏ ngFor and Trackby
❏ ngSwitchCase
❏ ngClass
❏ ngStyle
https://www.ifourtechnolab.com/
Introduction
❏ There are three kinds of directives in Angular:
❖ Components— directives with a template.
❖ Structural directives— change the DOM layout by adding and removing DOM elements.
❖ Attribute directives— change the appearance or behavior of an element, component, or another
directive.
❏ Structural Directives change the structure of the view. Two examples are NgFor and NgIf.
❏ Structural directives are easy to recognize. An asterisk (*) precedes the directive attribute name as in
this.
❏ Attribute directives are used as attributes of elements. The built-in NgStyle directive in the Template
Syntax guide, for example, can change several element styles at the same time.
https://www.ifourtechnolab.com/
NgIf
❏ <div *ngIf="hero" class="name">{{hero.name}}</div>
❏ No brackets. No parentheses. Just *ngIf set to a string.
❏ The asterisk (*) is a convenience notation and the string is a micro syntax rather than the usual template
expression.
❏ Render to
<ng-template [ngIf]="hero">
<div class="name">{{hero.name}}</div>
</ng-template>
❏ Angular desugars this notation into a marked-up <ng-template> that surrounds the host element and its
descendents. Each structural directive does something different with that template.
❏ Three of the common, built-in structural directives—NgIf, NgFor, and NgSwitch...—are described in the
Template
https://www.ifourtechnolab.com/
NgFor
<ul>
<li *ngFor="let hero of heroes">{{hero.name}}</li>
</ul>
Ref -> https://blog.angular-university.io/angular-2-ngfor/
❏ Angular transforms the *ngFor in similar fashion from asterisk (*) syntax to <ng-template> element.
<div *ngFor="let hero of heroes; let i=index; let odd=odd; trackBy: trackById" [class.odd]="odd">
({{i}}) {{hero.name}}
</div>
<ng-template ngFor let-hero [ngForOf]="heroes" let-i="index" let-odd="odd" [ngForTrackBy]="trackById">
<div [class.odd]="odd">({{i}}) {{hero.name}}</div>
</ng-template>
Angular transforms the *ngFor in similar fashion from asterisk (*) syntax to <ng-template> element.
<div *ngFor="let hero of heroes; let i=index; let odd=odd; trackBy: trackById" [class.odd]="odd">
({{i}}) {{hero.name}}
</div>
<ng-template ngFor let-hero [ngForOf]="heroes" let-i="index" let-odd="odd" [ngForTrackBy]="trackById">
<div [class.odd]="odd">({{i}}) {{hero.name}}</div>
</ng-template>
https://www.ifourtechnolab.com/
NgSwitch
❏ The Angular NgSwitch is actually a set of cooperating directives:
a. NgSwitch,
b. NgSwitchCase, and
c. NgSwitchDefault.
https://www.ifourtechnolab.com/
NgSwitch
❏ The Angular NgSwitch is actually a set of cooperating directives:
a. NgSwitch,
b. NgSwitchCase, and
c. NgSwitchDefault.
<ul [ngSwitch]="person.country">
<li *ngSwitchCase="'UK'" class="text-success">
{{ person.name }} ({{ person.country }})
</li>
<li *ngSwitchCase="'USA'" class="text-primary">
{{ person.name }} ({{ person.country }})
</li>
<li *ngSwitchDefault class="text-warning">
{{ person.name }} ({{ person.country }})
</li>
</ul>
https://www.ifourtechnolab.com/
NgClass
❏ Adds and removes CSS classes on an HTML element.
❏ The CSS classes are updated as follows, depending on the type of the expression evaluation:
a. string - the CSS classes listed in the string (space delimited) are added,
b. Array - the CSS classes declared as Array elements are added,
c. Object - keys are CSS classes that get added when the expression given in the value evaluates to a
truthy value, otherwise they are removed.
<some-element [ngClass]="'first second'">...</some-element>
<some-element [ngClass]="['first', 'second']">...</some-element>
<some-element [ngClass]="{'first': true, 'second': true, 'third': false}">...</some-element>
<some-element [ngClass]="string: Exp|array: Exp|obj: Exp">...</some-element>
<some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element>
https://www.ifourtechnolab.com/
NgStyle
❏ An attribute directive that updates styles for the containing HTML element.
❏ Sets one or more style properties, specified as colon-separated key-value pairs.
❏ The key is a style name, with an optional .
❏ <unit> suffix (such as 'top.px', 'font-style.em').
❏ The value is an expression to be evaluated.
❏ The resulting non-null value, expressed in the given unit, is assigned to the given style property.
❏ If the result of evaluation is null, the corresponding style is removed.
<some-element [ngStyle]="{'font-style': styleExp}">...</some-element>
<some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>
<some-element [ngStyle]="objExp">...</some-element>
https://www.ifourtechnolab.com/
Thank you
https://www.ifourtechnolab.com/

More Related Content

What's hot

Angular
AngularAngular
Building blocks of Angular
Building blocks of AngularBuilding blocks of Angular
Building blocks of Angular
Knoldus Inc.
 
Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2
Knoldus Inc.
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha Gadkari
Surekha Gadkari
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
Jadson Santos
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
WebStackAcademy
 
Angular Observables & RxJS Introduction
Angular Observables & RxJS IntroductionAngular Observables & RxJS Introduction
Angular Observables & RxJS Introduction
Rahat Khanna a.k.a mAppMechanic
 
Angular 2.0 forms
Angular 2.0 formsAngular 2.0 forms
Angular 2.0 forms
Eyal Vardi
 
Angular
AngularAngular
Angular
Lilia Sfaxi
 
Angular 5 presentation for beginners
Angular 5 presentation for beginnersAngular 5 presentation for beginners
Angular 5 presentation for beginners
Imran Qasim
 
Angular 14.pptx
Angular 14.pptxAngular 14.pptx
Angular 14.pptx
MohaNedGhawar
 
Angular Pipes Workshop
Angular Pipes WorkshopAngular Pipes Workshop
Angular Pipes Workshop
Nir Kaufman
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular Components
Squash Apps Pvt Ltd
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
Eyal Vardi
 
Angular Basics.pptx
Angular Basics.pptxAngular Basics.pptx
Angular Basics.pptx
AshokKumar616995
 
Introduzione ad angular 7/8
Introduzione ad angular 7/8Introduzione ad angular 7/8
Introduzione ad angular 7/8
Valerio Radice
 
Angular
AngularAngular
Angular introduction students
Angular introduction studentsAngular introduction students
Angular introduction students
Christian John Felix
 
Angular directives and pipes
Angular directives and pipesAngular directives and pipes
Angular directives and pipes
Knoldus Inc.
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshare
SaleemMalik52
 

What's hot (20)

Angular
AngularAngular
Angular
 
Building blocks of Angular
Building blocks of AngularBuilding blocks of Angular
Building blocks of Angular
 
Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha Gadkari
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
 
Angular Observables & RxJS Introduction
Angular Observables & RxJS IntroductionAngular Observables & RxJS Introduction
Angular Observables & RxJS Introduction
 
Angular 2.0 forms
Angular 2.0 formsAngular 2.0 forms
Angular 2.0 forms
 
Angular
AngularAngular
Angular
 
Angular 5 presentation for beginners
Angular 5 presentation for beginnersAngular 5 presentation for beginners
Angular 5 presentation for beginners
 
Angular 14.pptx
Angular 14.pptxAngular 14.pptx
Angular 14.pptx
 
Angular Pipes Workshop
Angular Pipes WorkshopAngular Pipes Workshop
Angular Pipes Workshop
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular Components
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
Angular Basics.pptx
Angular Basics.pptxAngular Basics.pptx
Angular Basics.pptx
 
Introduzione ad angular 7/8
Introduzione ad angular 7/8Introduzione ad angular 7/8
Introduzione ad angular 7/8
 
Angular
AngularAngular
Angular
 
Angular introduction students
Angular introduction studentsAngular introduction students
Angular introduction students
 
Angular directives and pipes
Angular directives and pipesAngular directives and pipes
Angular directives and pipes
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshare
 

Similar to Angular Directives

Agular 2 - 6 Directives
Agular 2 - 6 DirectivesAgular 2 - 6 Directives
Agular 2 - 6 Directives
Rajneeshksharma
 
Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Angular 2.0: Brighter future?
Angular 2.0: Brighter future?
Eugene Zharkov
 
AngularJS Workshop
AngularJS WorkshopAngularJS Workshop
AngularJS Workshop
Gianluca Cacace
 
Building AngularJS Custom Directives
Building AngularJS Custom DirectivesBuilding AngularJS Custom Directives
Building AngularJS Custom Directives
Dan Wahlin
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
WebStackAcademy
 
Angular
AngularAngular
Angular
LearningTech
 
Angular
AngularAngular
Angular
LearningTech
 
Angular js recommended practices - mini
Angular js   recommended practices - miniAngular js   recommended practices - mini
Angular js recommended practices - mini
Rasheed Waraich
 
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS Fundamentals
Aviran Cohen
 
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Alessandro Nadalin
 
Angular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решенияAngular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решения
Olga Lavrentieva
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design Patterns
Ran Mizrahi
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
Luigi De Russis
 
iOS best practices
iOS best practicesiOS best practices
iOS best practices
Maxim Vialyx
 
Angular js
Angular jsAngular js
Angular js
Brian Atkins
 
Angular js
Angular jsAngular js
Angular js
Baldeep Sohal
 
Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!
Doris Chen
 
gDayX - Advanced angularjs
gDayX - Advanced angularjsgDayX - Advanced angularjs
gDayX - Advanced angularjs
gdgvietnam
 
Unit 4(it workshop)
Unit 4(it workshop)Unit 4(it workshop)
Unit 4(it workshop)
Dr.Lokesh Gagnani
 
Basics of AngularJS
Basics of AngularJSBasics of AngularJS
Basics of AngularJS
Filip Janevski
 

Similar to Angular Directives (20)

Agular 2 - 6 Directives
Agular 2 - 6 DirectivesAgular 2 - 6 Directives
Agular 2 - 6 Directives
 
Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Angular 2.0: Brighter future?
Angular 2.0: Brighter future?
 
AngularJS Workshop
AngularJS WorkshopAngularJS Workshop
AngularJS Workshop
 
Building AngularJS Custom Directives
Building AngularJS Custom DirectivesBuilding AngularJS Custom Directives
Building AngularJS Custom Directives
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
 
Angular
AngularAngular
Angular
 
Angular
AngularAngular
Angular
 
Angular js recommended practices - mini
Angular js   recommended practices - miniAngular js   recommended practices - mini
Angular js recommended practices - mini
 
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS Fundamentals
 
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
Hey, I just met AngularJS, and this is crazy, so here’s my JavaScript, let’s ...
 
Angular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решенияAngular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решения
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design Patterns
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
 
iOS best practices
iOS best practicesiOS best practices
iOS best practices
 
Angular js
Angular jsAngular js
Angular js
 
Angular js
Angular jsAngular js
Angular js
 
Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!Angular or Backbone: Go Mobile!
Angular or Backbone: Go Mobile!
 
gDayX - Advanced angularjs
gDayX - Advanced angularjsgDayX - Advanced angularjs
gDayX - Advanced angularjs
 
Unit 4(it workshop)
Unit 4(it workshop)Unit 4(it workshop)
Unit 4(it workshop)
 
Basics of AngularJS
Basics of AngularJSBasics of AngularJS
Basics of AngularJS
 

More from iFour Technolab Pvt. Ltd.

7 Reasons to Migrate from Excel to Power BI | iFour
7 Reasons to Migrate from Excel to Power BI | iFour7 Reasons to Migrate from Excel to Power BI | iFour
7 Reasons to Migrate from Excel to Power BI | iFour
iFour Technolab Pvt. Ltd.
 
Software for Physiotherapists (+Physio) - Final.pdf
Software for Physiotherapists (+Physio) - Final.pdfSoftware for Physiotherapists (+Physio) - Final.pdf
Software for Physiotherapists (+Physio) - Final.pdf
iFour Technolab Pvt. Ltd.
 
Evolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfEvolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdf
iFour Technolab Pvt. Ltd.
 
iFour Technolab - .NET Development Company Profile
iFour Technolab - .NET Development Company ProfileiFour Technolab - .NET Development Company Profile
iFour Technolab - .NET Development Company Profile
iFour Technolab Pvt. Ltd.
 
Java9to19Final.pptx
Java9to19Final.pptxJava9to19Final.pptx
Java9to19Final.pptx
iFour Technolab Pvt. Ltd.
 
Meetup - IoT with Azure behind the scenes 2022.pptx
Meetup - IoT with Azure behind the scenes 2022.pptxMeetup - IoT with Azure behind the scenes 2022.pptx
Meetup - IoT with Azure behind the scenes 2022.pptx
iFour Technolab Pvt. Ltd.
 
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022
iFour Technolab Pvt. Ltd.
 
NFT_Meetup - iFour Technolab.pptx
NFT_Meetup - iFour Technolab.pptxNFT_Meetup - iFour Technolab.pptx
NFT_Meetup - iFour Technolab.pptx
iFour Technolab Pvt. Ltd.
 
Complete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabComplete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour Technolab
iFour Technolab Pvt. Ltd.
 
ASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour TechnolabASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour Technolab
iFour Technolab Pvt. Ltd.
 
Basic Introduction and Overview of Vue.js
Basic Introduction and Overview of Vue.jsBasic Introduction and Overview of Vue.js
Basic Introduction and Overview of Vue.js
iFour Technolab Pvt. Ltd.
 
Basic Introduction of VSTO Office Add-in Software Development - iFour Technolab
Basic Introduction of VSTO Office Add-in Software Development - iFour TechnolabBasic Introduction of VSTO Office Add-in Software Development - iFour Technolab
Basic Introduction of VSTO Office Add-in Software Development - iFour Technolab
iFour Technolab Pvt. Ltd.
 
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.
iFour Technolab Pvt. Ltd.
 
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.
iFour Technolab Pvt. Ltd.
 
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.
iFour Technolab Pvt. Ltd.
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)
iFour Technolab Pvt. Ltd.
 
Tutorial on Node File System
Tutorial on Node File SystemTutorial on Node File System
Tutorial on Node File System
iFour Technolab Pvt. Ltd.
 
MongoDB Introduction, Installation & Execution
MongoDB Introduction, Installation & ExecutionMongoDB Introduction, Installation & Execution
MongoDB Introduction, Installation & Execution
iFour Technolab Pvt. Ltd.
 
Controls Use in Windows Presentation Foundation (WPF)
Controls Use in Windows Presentation Foundation (WPF)Controls Use in Windows Presentation Foundation (WPF)
Controls Use in Windows Presentation Foundation (WPF)
iFour Technolab Pvt. Ltd.
 
Agile Project Management with Scrum PDF
Agile Project Management with Scrum PDFAgile Project Management with Scrum PDF
Agile Project Management with Scrum PDF
iFour Technolab Pvt. Ltd.
 

More from iFour Technolab Pvt. Ltd. (20)

7 Reasons to Migrate from Excel to Power BI | iFour
7 Reasons to Migrate from Excel to Power BI | iFour7 Reasons to Migrate from Excel to Power BI | iFour
7 Reasons to Migrate from Excel to Power BI | iFour
 
Software for Physiotherapists (+Physio) - Final.pdf
Software for Physiotherapists (+Physio) - Final.pdfSoftware for Physiotherapists (+Physio) - Final.pdf
Software for Physiotherapists (+Physio) - Final.pdf
 
Evolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfEvolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdf
 
iFour Technolab - .NET Development Company Profile
iFour Technolab - .NET Development Company ProfileiFour Technolab - .NET Development Company Profile
iFour Technolab - .NET Development Company Profile
 
Java9to19Final.pptx
Java9to19Final.pptxJava9to19Final.pptx
Java9to19Final.pptx
 
Meetup - IoT with Azure behind the scenes 2022.pptx
Meetup - IoT with Azure behind the scenes 2022.pptxMeetup - IoT with Azure behind the scenes 2022.pptx
Meetup - IoT with Azure behind the scenes 2022.pptx
 
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022
 
NFT_Meetup - iFour Technolab.pptx
NFT_Meetup - iFour Technolab.pptxNFT_Meetup - iFour Technolab.pptx
NFT_Meetup - iFour Technolab.pptx
 
Complete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabComplete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour Technolab
 
ASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour TechnolabASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour Technolab
 
Basic Introduction and Overview of Vue.js
Basic Introduction and Overview of Vue.jsBasic Introduction and Overview of Vue.js
Basic Introduction and Overview of Vue.js
 
Basic Introduction of VSTO Office Add-in Software Development - iFour Technolab
Basic Introduction of VSTO Office Add-in Software Development - iFour TechnolabBasic Introduction of VSTO Office Add-in Software Development - iFour Technolab
Basic Introduction of VSTO Office Add-in Software Development - iFour Technolab
 
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.
 
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.
 
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)
 
Tutorial on Node File System
Tutorial on Node File SystemTutorial on Node File System
Tutorial on Node File System
 
MongoDB Introduction, Installation & Execution
MongoDB Introduction, Installation & ExecutionMongoDB Introduction, Installation & Execution
MongoDB Introduction, Installation & Execution
 
Controls Use in Windows Presentation Foundation (WPF)
Controls Use in Windows Presentation Foundation (WPF)Controls Use in Windows Presentation Foundation (WPF)
Controls Use in Windows Presentation Foundation (WPF)
 
Agile Project Management with Scrum PDF
Agile Project Management with Scrum PDFAgile Project Management with Scrum PDF
Agile Project Management with Scrum PDF
 

Recently uploaded

Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matta Matka Indian Matka Satta Matka Dpboss Matka boss otg Indian Matka
Satta Matta Matka Indian Matka Satta Matka Dpboss Matka boss otg Indian MatkaSatta Matta Matka Indian Matka Satta Matka Dpboss Matka boss otg Indian Matka
Satta Matta Matka Indian Matka Satta Matka Dpboss Matka boss otg Indian Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
Matka Boss otg Satta Matta Matka Kalyan Matka Indian Matka
Matka Boss otg Satta Matta Matka Kalyan Matka Indian MatkaMatka Boss otg Satta Matta Matka Kalyan Matka Indian Matka
Matka Boss otg Satta Matta Matka Kalyan Matka Indian Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
Indian Matka Dpboss Matka Guessing Tara Matka boss otg
Indian Matka Dpboss Matka Guessing Tara Matka boss otgIndian Matka Dpboss Matka Guessing Tara Matka boss otg
Matka boss otg satta matka kalyan matka Dpboss Matka guessing Indian Matka
Matka boss otg satta matka kalyan matka Dpboss Matka guessing Indian MatkaMatka boss otg satta matka kalyan matka Dpboss Matka guessing Indian Matka
Matka boss otg satta matka kalyan matka Dpboss Matka guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
Satta Matka India Matka Satta Kalyan Chart
Satta Matka India Matka Satta Kalyan ChartSatta Matka India Matka Satta Kalyan Chart
Satta Matka India Matka Satta Kalyan Chart
India Matka
 
DPBOSS GUESSING KALYAN SATTA MATKA KALYAN CHAT
DPBOSS GUESSING KALYAN SATTA MATKA KALYAN CHATDPBOSS GUESSING KALYAN SATTA MATKA KALYAN CHAT
➒➌➎➏➑➐➋➑➐➐ Satta matka Dpboss kalyan Result Indian Matka matka boss otg Dpbos...
➒➌➎➏➑➐➋➑➐➐ Satta matka Dpboss kalyan Result Indian Matka matka boss otg Dpbos...➒➌➎➏➑➐➋➑➐➐ Satta matka Dpboss kalyan Result Indian Matka matka boss otg Dpbos...
➒➌➎➏➑➐➋➑➐➐ Satta matka Dpboss kalyan Result Indian Matka matka boss otg Dpbos...
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
9348597990SATTA MATKA DPBOSS KALYAN CHART RESULT FIRST FINAL ANK
9348597990SATTA MATKA DPBOSS KALYAN CHART RESULT FIRST FINAL ANK9348597990SATTA MATKA DPBOSS KALYAN CHART RESULT FIRST FINAL ANK
9348597990SATTA MATKA DPBOSS KALYAN CHART RESULT FIRST FINAL ANK
❾❸❹❽❺❾❼❾❾⓿SATTA MATKA DPBOSS KALYAN MAIN BAZAR FAST MATKA ...
 
Satta Matta Matka 143 ,Kalyan Matka 420.
Satta Matta Matka 143 ,Kalyan Matka 420.Satta Matta Matka 143 ,Kalyan Matka 420.
Satta Matta Matka 143 ,Kalyan Matka 420.
Matka Guessing ❼ʘ❷ʘ❻❻➃➆➆➀ Matka Result
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart Call-⑨③④⑧⑧③⑥⑧⑧⑦
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart Call-⑨③④⑧⑧③⑥⑧⑧⑦Satta Matka Dpboss Kalyan Matka Results Kalyan Chart Call-⑨③④⑧⑧③⑥⑧⑧⑦
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart Call-⑨③④⑧⑧③⑥⑧⑧⑦
DP Boss Satta Matka Kalyan Matka
 
Kalyan Satta Matka Guessing Dp boss..143
Kalyan Satta Matka Guessing Dp boss..143Kalyan Satta Matka Guessing Dp boss..143
Kalyan Satta Matka Guessing Dp boss..143
Matka Guessing ❼ʘ❷ʘ❻❻➃➆➆➀ Matka Result
 
Kalyan Matka Guessing | Satta Matka 420
Kalyan Matka Guessing | Satta  Matka 420Kalyan Matka Guessing | Satta  Matka 420
Kalyan Matka Guessing | Satta Matka 420
Matka Guessing ❼ʘ❷ʘ❻❻➃➆➆➀ Matka Result
 
Satta Matta Matka Kalyan Matka Satta Matka Dpboss Matka Guessing Kalyan Matka
Satta Matta Matka Kalyan Matka Satta Matka Dpboss Matka Guessing Kalyan MatkaSatta Matta Matka Kalyan Matka Satta Matka Dpboss Matka Guessing Kalyan Matka
Satta Matta Matka Kalyan Matka Satta Matka Dpboss Matka Guessing Kalyan Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
Satta Matka Kalyan Satta Matka guessing.
Satta Matka Kalyan Satta Matka guessing.Satta Matka Kalyan Satta Matka guessing.
Satta Matka Kalyan Satta Matka guessing.
Matka Guessing ❼ʘ❷ʘ❻❻➃➆➆➀ Matka Result
 
Indian Matka Dpboss Matka Guessing Kalyan panel Chart Matka Boss otg
Indian Matka Dpboss Matka Guessing Kalyan panel Chart Matka Boss otgIndian Matka Dpboss Matka Guessing Kalyan panel Chart Matka Boss otg
Indian Matka Dpboss Matka Guessing Kalyan panel Chart Matka Boss otg
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
Matka boss otg satta Matta matka Indian Matka Tara Matka
Matka boss otg satta Matta matka Indian Matka Tara MatkaMatka boss otg satta Matta matka Indian Matka Tara Matka
Satta batta Matka Guessing Satta Matta Matka Indian Matka
Satta batta Matka Guessing Satta Matta Matka Indian MatkaSatta batta Matka Guessing Satta Matta Matka Indian Matka
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
How AI is Disrupting Service Industry More Than Design Thinking
How AI is Disrupting Service Industry More Than Design ThinkingHow AI is Disrupting Service Industry More Than Design Thinking
How AI is Disrupting Service Industry More Than Design Thinking
Body of Knowledge
 

Recently uploaded (20)

Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
 
Satta Matta Matka Indian Matka Satta Matka Dpboss Matka boss otg Indian Matka
Satta Matta Matka Indian Matka Satta Matka Dpboss Matka boss otg Indian MatkaSatta Matta Matka Indian Matka Satta Matka Dpboss Matka boss otg Indian Matka
Satta Matta Matka Indian Matka Satta Matka Dpboss Matka boss otg Indian Matka
 
Matka Boss otg Satta Matta Matka Kalyan Matka Indian Matka
Matka Boss otg Satta Matta Matka Kalyan Matka Indian MatkaMatka Boss otg Satta Matta Matka Kalyan Matka Indian Matka
Matka Boss otg Satta Matta Matka Kalyan Matka Indian Matka
 
Indian Matka Dpboss Matka Guessing Tara Matka boss otg
Indian Matka Dpboss Matka Guessing Tara Matka boss otgIndian Matka Dpboss Matka Guessing Tara Matka boss otg
Indian Matka Dpboss Matka Guessing Tara Matka boss otg
 
Matka boss otg satta matka kalyan matka Dpboss Matka guessing Indian Matka
Matka boss otg satta matka kalyan matka Dpboss Matka guessing Indian MatkaMatka boss otg satta matka kalyan matka Dpboss Matka guessing Indian Matka
Matka boss otg satta matka kalyan matka Dpboss Matka guessing Indian Matka
 
Satta Matka India Matka Satta Kalyan Chart
Satta Matka India Matka Satta Kalyan ChartSatta Matka India Matka Satta Kalyan Chart
Satta Matka India Matka Satta Kalyan Chart
 
DPBOSS GUESSING KALYAN SATTA MATKA KALYAN CHAT
DPBOSS GUESSING KALYAN SATTA MATKA KALYAN CHATDPBOSS GUESSING KALYAN SATTA MATKA KALYAN CHAT
DPBOSS GUESSING KALYAN SATTA MATKA KALYAN CHAT
 
➒➌➎➏➑➐➋➑➐➐ Satta matka Dpboss kalyan Result Indian Matka matka boss otg Dpbos...
➒➌➎➏➑➐➋➑➐➐ Satta matka Dpboss kalyan Result Indian Matka matka boss otg Dpbos...➒➌➎➏➑➐➋➑➐➐ Satta matka Dpboss kalyan Result Indian Matka matka boss otg Dpbos...
➒➌➎➏➑➐➋➑➐➐ Satta matka Dpboss kalyan Result Indian Matka matka boss otg Dpbos...
 
9348597990SATTA MATKA DPBOSS KALYAN CHART RESULT FIRST FINAL ANK
9348597990SATTA MATKA DPBOSS KALYAN CHART RESULT FIRST FINAL ANK9348597990SATTA MATKA DPBOSS KALYAN CHART RESULT FIRST FINAL ANK
9348597990SATTA MATKA DPBOSS KALYAN CHART RESULT FIRST FINAL ANK
 
Satta Matta Matka 143 ,Kalyan Matka 420.
Satta Matta Matka 143 ,Kalyan Matka 420.Satta Matta Matka 143 ,Kalyan Matka 420.
Satta Matta Matka 143 ,Kalyan Matka 420.
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart Call-⑨③④⑧⑧③⑥⑧⑧⑦
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart Call-⑨③④⑧⑧③⑥⑧⑧⑦Satta Matka Dpboss Kalyan Matka Results Kalyan Chart Call-⑨③④⑧⑧③⑥⑧⑧⑦
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart Call-⑨③④⑧⑧③⑥⑧⑧⑦
 
Kalyan Satta Matka Guessing Dp boss..143
Kalyan Satta Matka Guessing Dp boss..143Kalyan Satta Matka Guessing Dp boss..143
Kalyan Satta Matka Guessing Dp boss..143
 
Kalyan Matka Guessing | Satta Matka 420
Kalyan Matka Guessing | Satta  Matka 420Kalyan Matka Guessing | Satta  Matka 420
Kalyan Matka Guessing | Satta Matka 420
 
Satta Matta Matka Kalyan Matka Satta Matka Dpboss Matka Guessing Kalyan Matka
Satta Matta Matka Kalyan Matka Satta Matka Dpboss Matka Guessing Kalyan MatkaSatta Matta Matka Kalyan Matka Satta Matka Dpboss Matka Guessing Kalyan Matka
Satta Matta Matka Kalyan Matka Satta Matka Dpboss Matka Guessing Kalyan Matka
 
Satta Matka Kalyan Satta Matka guessing.
Satta Matka Kalyan Satta Matka guessing.Satta Matka Kalyan Satta Matka guessing.
Satta Matka Kalyan Satta Matka guessing.
 
Indian Matka Dpboss Matka Guessing Kalyan panel Chart Matka Boss otg
Indian Matka Dpboss Matka Guessing Kalyan panel Chart Matka Boss otgIndian Matka Dpboss Matka Guessing Kalyan panel Chart Matka Boss otg
Indian Matka Dpboss Matka Guessing Kalyan panel Chart Matka Boss otg
 
Matka boss otg satta Matta matka Indian Matka Tara Matka
Matka boss otg satta Matta matka Indian Matka Tara MatkaMatka boss otg satta Matta matka Indian Matka Tara Matka
Matka boss otg satta Matta matka Indian Matka Tara Matka
 
Satta batta Matka Guessing Satta Matta Matka Indian Matka
Satta batta Matka Guessing Satta Matta Matka Indian MatkaSatta batta Matka Guessing Satta Matta Matka Indian Matka
Satta batta Matka Guessing Satta Matta Matka Indian Matka
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
 
How AI is Disrupting Service Industry More Than Design Thinking
How AI is Disrupting Service Industry More Than Design ThinkingHow AI is Disrupting Service Industry More Than Design Thinking
How AI is Disrupting Service Industry More Than Design Thinking
 

Angular Directives

  • 2. Index ❏ Introduction ❏ ngIf ❏ ngFor ❏ ngFor and Trackby ❏ ngSwitchCase ❏ ngClass ❏ ngStyle https://www.ifourtechnolab.com/
  • 3. Introduction ❏ There are three kinds of directives in Angular: ❖ Components— directives with a template. ❖ Structural directives— change the DOM layout by adding and removing DOM elements. ❖ Attribute directives— change the appearance or behavior of an element, component, or another directive. ❏ Structural Directives change the structure of the view. Two examples are NgFor and NgIf. ❏ Structural directives are easy to recognize. An asterisk (*) precedes the directive attribute name as in this. ❏ Attribute directives are used as attributes of elements. The built-in NgStyle directive in the Template Syntax guide, for example, can change several element styles at the same time. https://www.ifourtechnolab.com/
  • 4. NgIf ❏ <div *ngIf="hero" class="name">{{hero.name}}</div> ❏ No brackets. No parentheses. Just *ngIf set to a string. ❏ The asterisk (*) is a convenience notation and the string is a micro syntax rather than the usual template expression. ❏ Render to <ng-template [ngIf]="hero"> <div class="name">{{hero.name}}</div> </ng-template> ❏ Angular desugars this notation into a marked-up <ng-template> that surrounds the host element and its descendents. Each structural directive does something different with that template. ❏ Three of the common, built-in structural directives—NgIf, NgFor, and NgSwitch...—are described in the Template https://www.ifourtechnolab.com/
  • 5. NgFor <ul> <li *ngFor="let hero of heroes">{{hero.name}}</li> </ul> Ref -> https://blog.angular-university.io/angular-2-ngfor/ ❏ Angular transforms the *ngFor in similar fashion from asterisk (*) syntax to <ng-template> element. <div *ngFor="let hero of heroes; let i=index; let odd=odd; trackBy: trackById" [class.odd]="odd"> ({{i}}) {{hero.name}} </div> <ng-template ngFor let-hero [ngForOf]="heroes" let-i="index" let-odd="odd" [ngForTrackBy]="trackById"> <div [class.odd]="odd">({{i}}) {{hero.name}}</div> </ng-template> Angular transforms the *ngFor in similar fashion from asterisk (*) syntax to <ng-template> element. <div *ngFor="let hero of heroes; let i=index; let odd=odd; trackBy: trackById" [class.odd]="odd"> ({{i}}) {{hero.name}} </div> <ng-template ngFor let-hero [ngForOf]="heroes" let-i="index" let-odd="odd" [ngForTrackBy]="trackById"> <div [class.odd]="odd">({{i}}) {{hero.name}}</div> </ng-template> https://www.ifourtechnolab.com/
  • 6. NgSwitch ❏ The Angular NgSwitch is actually a set of cooperating directives: a. NgSwitch, b. NgSwitchCase, and c. NgSwitchDefault. https://www.ifourtechnolab.com/
  • 7. NgSwitch ❏ The Angular NgSwitch is actually a set of cooperating directives: a. NgSwitch, b. NgSwitchCase, and c. NgSwitchDefault. <ul [ngSwitch]="person.country"> <li *ngSwitchCase="'UK'" class="text-success"> {{ person.name }} ({{ person.country }}) </li> <li *ngSwitchCase="'USA'" class="text-primary"> {{ person.name }} ({{ person.country }}) </li> <li *ngSwitchDefault class="text-warning"> {{ person.name }} ({{ person.country }}) </li> </ul> https://www.ifourtechnolab.com/
  • 8. NgClass ❏ Adds and removes CSS classes on an HTML element. ❏ The CSS classes are updated as follows, depending on the type of the expression evaluation: a. string - the CSS classes listed in the string (space delimited) are added, b. Array - the CSS classes declared as Array elements are added, c. Object - keys are CSS classes that get added when the expression given in the value evaluates to a truthy value, otherwise they are removed. <some-element [ngClass]="'first second'">...</some-element> <some-element [ngClass]="['first', 'second']">...</some-element> <some-element [ngClass]="{'first': true, 'second': true, 'third': false}">...</some-element> <some-element [ngClass]="string: Exp|array: Exp|obj: Exp">...</some-element> <some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element> https://www.ifourtechnolab.com/
  • 9. NgStyle ❏ An attribute directive that updates styles for the containing HTML element. ❏ Sets one or more style properties, specified as colon-separated key-value pairs. ❏ The key is a style name, with an optional . ❏ <unit> suffix (such as 'top.px', 'font-style.em'). ❏ The value is an expression to be evaluated. ❏ The resulting non-null value, expressed in the given unit, is assigned to the given style property. ❏ If the result of evaluation is null, the corresponding style is removed. <some-element [ngStyle]="{'font-style': styleExp}">...</some-element> <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element> <some-element [ngStyle]="objExp">...</some-element> https://www.ifourtechnolab.com/