SlideShare a Scribd company logo
1 of 22
Download to read offline
Software IndustrySultan Ahmed Sagor
Angular 7
A framework for Presentation Layer
Software IndustrySultan Ahmed Sagor
Software IndustrySultan Ahmed Sagor
Angular Data Binding7
Software IndustrySultan Ahmed Sagor
Angular Tutorial: Road Covered So Far
Software IndustrySultan Ahmed Sagor
What is Directives ?
Now we will discuss angular directives
Software IndustrySultan Ahmed Sagor
What is directives?
Angular templates are dynamic. When Angular renders them, it transforms the DOM
according to the instructions given by Directives.
Directives
manipulates
Software IndustrySultan Ahmed Sagor
Type of Angular Directives
Now we will see types of Angular directives
Software IndustrySultan Ahmed Sagor
Type of Angular Directives
Software IndustrySultan Ahmed Sagor
Component Directives
Now we will discuss about component directives
Software IndustrySultan Ahmed Sagor
Component Directives
Software IndustrySultan Ahmed Sagor
Built-in Structural Directives
Now we will discuss about structural directives
Software IndustrySultan Ahmed Sagor
Structural Directives
Software IndustrySultan Ahmed Sagor
ng-template structural Directive
❖ content of ng-template tag will not be displayed in browser.
❖ Check the following code in visual code:
❖ Now run the project using the following command:
<h2>Welcome</h2>
<ng-template> to </ng-template>
<h2>Corporate knowledge sharing session</h2>
Software IndustrySultan Ahmed Sagor
*ngIf structural Directive
❖ acts according to some given direction. :
❖ When condition is true, the element is added to the DOM.
❖ We can use ng-template tag for else decision.
❖ By using *ngIf directive we can develop complex front-end easily.
Software IndustrySultan Ahmed Sagor
*ngIf structural Directive
<button (click)="show = !show">
{{show ? 'hide' : 'show’}}
</button>
show = {{show}}
<br>
<div *ngIf="show; else elseBlock">
Text to show
</div>
<ng-template #elseBlock>
Alternate text while primary text is hidden
</ng-template>
show: boolean = true;
Software IndustrySultan Ahmed Sagor
*ngFor structural Directive
❖ The *ngFor directive is used to repeat a portion of HTML template once per each item from an
iterable list (Collection).
❖ To Use ngFor directive, you have to create a block of HTML elements, which can display a single item
of the items collection.
❖ After that you can use the ngFor directive to tell angular to repeat that block of HTML elements for
each item in the list.
<li *ngFor="let item of items;"> .... </li>
Software IndustrySultan Ahmed Sagor
*ngFor structural Directive
class Movie {
title : string;
director : string;
cast : string;
releaseDate : string;
}
title: string ="Top 10 Movies" ;
movies: Movie[] =[
{title:'Zootopia',director:'Byron Howard, Rich Moor
e',cast:'Idris Elba, Ginnifer Goodwin, Jason Bateman',r
eleaseDate:'March 4, 2016'},
{title:'Batman v Superman: Dawn of Justice',direct
or:'Zack Snyder',cast:'Ben Affleck, Henry Cavill, Amy A
dams',releaseDate:'March 25, 2016'},
{title:'Captain America: Civil War',director:'Anthony
Russo, Joe Russo',cast:'Scarlett Johansson, Elizabeth
Olsen, Chris Evans',releaseDate:'May 6, 2016'},
{title:'X-
Men: Apocalypse',director:'Bryan Singer',cast:'Jennifer
Lawrence, Olivia Munn, Oscar Isaac',releaseDate:'May
27, 2016'},
]
Software IndustrySultan Ahmed Sagor
*ngFor structural Directive
<table class='table'>
<thead>
<tr>
<th>Title</th>
<th>Director</th>
<th>Cast</th>
<th>Release Date</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let movie of movies;">
<td>{{movie.title}}</td>
<td>{{movie.director}}</td>
<td>{{movie.cast}}</td>
<td>{{movie.releaseDate}}</td>
</tr>
</tbody>
</table>
<div class='panel panel-primary'>
<div class='panel-heading'>
{{title}}
</div>
<div class='panel-body'>
<div class='table-responsive’>
</div>
</div>
</div>
Software IndustrySultan Ahmed Sagor
*ngSwitch structural Directive
❖ In Angular 8, ngSwitch is a structural directive which is used to Add/Remove DOM Element.
❖ It is similar to switch statement of C#. The ngSwitch directive is applied to the container element with
a switch expression.
<container_element [ngSwitch]="switch_expression">
<inner_element *ngSwitchCase="match_expresson_1">...</inner_element>
<inner_element *ngSwitchCase="match_expresson_2">...</inner_element>
<inner_element *ngSwitchCase="match_expresson_3">...</inner_element>
<inner_element *ngSwitchDefault>...</element>
</container_element>
Software IndustrySultan Ahmed Sagor
*ngSwitch structural Directive
class item {
name: string;
val: number;
}
export class AppComponent
{
items: item[] = [{name: 'One', val: 1}, {name: 'T
wo', val: 2}, {name: 'Three', val: 3}];
selectedValue: string= 'One';
}
<select [(ngModel)]="selectedValue">
<option *ngFor="let item of items;" [value]="item.na
me">{{item.name}}</option>
</select>
<div class='row' [ngSwitch]="selectedValue">
<div *ngSwitchCase="'One'">One is Pressed</div>
<div *ngSwitchCase="'Two'">Two is Selected</div>
<div *ngSwitchDefault>Default Option</div>
</div>
Software IndustrySultan Ahmed Sagor
Any
question?
Software IndustrySultan Ahmed Sagor
Thank You

More Related Content

What's hot

Different way to share data between controllers in angular js
Different way to share data between controllers in angular jsDifferent way to share data between controllers in angular js
Different way to share data between controllers in angular jscodeandyou forums
 
Controllers in AngularJs
Controllers in AngularJsControllers in AngularJs
Controllers in AngularJsK Arunkumar
 
Angular.js interview questions
Angular.js interview questionsAngular.js interview questions
Angular.js interview questionscodeandyou forums
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSAnass90
 
Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2 Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2 Ross Dederer
 
AngularJS for Beginners
AngularJS for BeginnersAngularJS for Beginners
AngularJS for BeginnersEdureka!
 
Code migration from Angular 1.x to Angular 2.0
Code migration from Angular 1.x to Angular 2.0Code migration from Angular 1.x to Angular 2.0
Code migration from Angular 1.x to Angular 2.0Ran Wahle
 
AngularJS: Service, factory & provider
AngularJS: Service, factory & providerAngularJS: Service, factory & provider
AngularJS: Service, factory & providerCorley S.r.l.
 
Angularjs on line training
Angularjs on line trainingAngularjs on line training
Angularjs on line trainingJahan Murugassan
 
Corley cloud angular in cloud
Corley cloud   angular in cloudCorley cloud   angular in cloud
Corley cloud angular in cloudCorley S.r.l.
 
Shaping up with angular JS
Shaping up with angular JSShaping up with angular JS
Shaping up with angular JSBrajesh Yadav
 
Angular js getting started
Angular js getting startedAngular js getting started
Angular js getting startedHemant Mali
 
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinWill your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinBarry Gervin
 
Useful jQuery tips, tricks, and plugins with ASP.NET MVC
Useful jQuery tips, tricks, and plugins with ASP.NET MVCUseful jQuery tips, tricks, and plugins with ASP.NET MVC
Useful jQuery tips, tricks, and plugins with ASP.NET MVCElijah Manor
 

What's hot (20)

Angular from Scratch
Angular from ScratchAngular from Scratch
Angular from Scratch
 
Different way to share data between controllers in angular js
Different way to share data between controllers in angular jsDifferent way to share data between controllers in angular js
Different way to share data between controllers in angular js
 
Controllers in AngularJs
Controllers in AngularJsControllers in AngularJs
Controllers in AngularJs
 
Angular.js interview questions
Angular.js interview questionsAngular.js interview questions
Angular.js interview questions
 
AngularJS
AngularJSAngularJS
AngularJS
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2 Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2
 
AngularJS
AngularJSAngularJS
AngularJS
 
Directives
DirectivesDirectives
Directives
 
AngularJS for Beginners
AngularJS for BeginnersAngularJS for Beginners
AngularJS for Beginners
 
Code migration from Angular 1.x to Angular 2.0
Code migration from Angular 1.x to Angular 2.0Code migration from Angular 1.x to Angular 2.0
Code migration from Angular 1.x to Angular 2.0
 
AngularJS: Service, factory & provider
AngularJS: Service, factory & providerAngularJS: Service, factory & provider
AngularJS: Service, factory & provider
 
Angularjs on line training
Angularjs on line trainingAngularjs on line training
Angularjs on line training
 
Corley cloud angular in cloud
Corley cloud   angular in cloudCorley cloud   angular in cloud
Corley cloud angular in cloud
 
Shaping up with angular JS
Shaping up with angular JSShaping up with angular JS
Shaping up with angular JS
 
Angular JS
Angular JSAngular JS
Angular JS
 
Angular 2 - An Introduction
Angular 2 - An IntroductionAngular 2 - An Introduction
Angular 2 - An Introduction
 
Angular js getting started
Angular js getting startedAngular js getting started
Angular js getting started
 
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinWill your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
 
Useful jQuery tips, tricks, and plugins with ASP.NET MVC
Useful jQuery tips, tricks, and plugins with ASP.NET MVCUseful jQuery tips, tricks, and plugins with ASP.NET MVC
Useful jQuery tips, tricks, and plugins with ASP.NET MVC
 

Similar to Angular directives

Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil Tayar
Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil TayarVisual Testing: The Missing Piece of the Puzzle -- presentation by Gil Tayar
Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil TayarApplitools
 
Angular components
Angular componentsAngular components
Angular componentsSultan Ahmed
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...Katy Slemon
 
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016Codemotion
 
Animation And Testing In AngularJS
Animation And Testing In AngularJSAnimation And Testing In AngularJS
Animation And Testing In AngularJSEdureka!
 
Play with Angular JS
Play with Angular JSPlay with Angular JS
Play with Angular JSKnoldus Inc.
 
Google Developer Groups, Why We Choose Angular.js
Google Developer Groups, Why We Choose Angular.jsGoogle Developer Groups, Why We Choose Angular.js
Google Developer Groups, Why We Choose Angular.jsAlmog Koren
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Arunangsu Sahu
 
Formation angular js/Ionic
Formation angular js/IonicFormation angular js/Ionic
Formation angular js/IonicHana Amiri
 
SUGCON ANZ 2022 Sitecore Personalize Technical.pptx
SUGCON ANZ 2022 Sitecore Personalize Technical.pptxSUGCON ANZ 2022 Sitecore Personalize Technical.pptx
SUGCON ANZ 2022 Sitecore Personalize Technical.pptxJitendra Soni
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...Hafez Kamal
 
Getting Started With AngularJS
Getting Started With AngularJSGetting Started With AngularJS
Getting Started With AngularJSOmnia Helmi
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS BasicsRavi Mone
 
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ... Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...Andy Maleh
 

Similar to Angular directives (20)

Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil Tayar
Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil TayarVisual Testing: The Missing Piece of the Puzzle -- presentation by Gil Tayar
Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil Tayar
 
Angular components
Angular componentsAngular components
Angular components
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
 
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016
Hacking for Salone: Drone Races - Di Saverio; Lippolis - Codemotion Milan 2016
 
Hacking for salone: drone races
Hacking for salone: drone racesHacking for salone: drone races
Hacking for salone: drone races
 
Animation And Testing In AngularJS
Animation And Testing In AngularJSAnimation And Testing In AngularJS
Animation And Testing In AngularJS
 
Play with Angular JS
Play with Angular JSPlay with Angular JS
Play with Angular JS
 
Angular | Dev Love Components
Angular | Dev Love ComponentsAngular | Dev Love Components
Angular | Dev Love Components
 
Google Developer Groups, Why We Choose Angular.js
Google Developer Groups, Why We Choose Angular.jsGoogle Developer Groups, Why We Choose Angular.js
Google Developer Groups, Why We Choose Angular.js
 
Angular js
Angular jsAngular js
Angular js
 
AngularJs
AngularJsAngularJs
AngularJs
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01
 
Formation angular js/Ionic
Formation angular js/IonicFormation angular js/Ionic
Formation angular js/Ionic
 
SUGCON ANZ 2022 Sitecore Personalize Technical.pptx
SUGCON ANZ 2022 Sitecore Personalize Technical.pptxSUGCON ANZ 2022 Sitecore Personalize Technical.pptx
SUGCON ANZ 2022 Sitecore Personalize Technical.pptx
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
 
Getting Started With AngularJS
Getting Started With AngularJSGetting Started With AngularJS
Getting Started With AngularJS
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Angular - Beginner
Angular - BeginnerAngular - Beginner
Angular - Beginner
 
JS performance tools
JS performance toolsJS performance tools
JS performance tools
 
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ... Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
Montreal.rb 2022-10-05 - Glimmer DSL for SWT - Ruby Desktop Development GUI ...
 

Recently uploaded

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 

Recently uploaded (20)

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 

Angular directives

  • 1. Software IndustrySultan Ahmed Sagor Angular 7 A framework for Presentation Layer
  • 3. Software IndustrySultan Ahmed Sagor Angular Data Binding7
  • 4. Software IndustrySultan Ahmed Sagor Angular Tutorial: Road Covered So Far
  • 5. Software IndustrySultan Ahmed Sagor What is Directives ? Now we will discuss angular directives
  • 6. Software IndustrySultan Ahmed Sagor What is directives? Angular templates are dynamic. When Angular renders them, it transforms the DOM according to the instructions given by Directives. Directives manipulates
  • 7. Software IndustrySultan Ahmed Sagor Type of Angular Directives Now we will see types of Angular directives
  • 8. Software IndustrySultan Ahmed Sagor Type of Angular Directives
  • 9. Software IndustrySultan Ahmed Sagor Component Directives Now we will discuss about component directives
  • 10. Software IndustrySultan Ahmed Sagor Component Directives
  • 11. Software IndustrySultan Ahmed Sagor Built-in Structural Directives Now we will discuss about structural directives
  • 12. Software IndustrySultan Ahmed Sagor Structural Directives
  • 13. Software IndustrySultan Ahmed Sagor ng-template structural Directive ❖ content of ng-template tag will not be displayed in browser. ❖ Check the following code in visual code: ❖ Now run the project using the following command: <h2>Welcome</h2> <ng-template> to </ng-template> <h2>Corporate knowledge sharing session</h2>
  • 14. Software IndustrySultan Ahmed Sagor *ngIf structural Directive ❖ acts according to some given direction. : ❖ When condition is true, the element is added to the DOM. ❖ We can use ng-template tag for else decision. ❖ By using *ngIf directive we can develop complex front-end easily.
  • 15. Software IndustrySultan Ahmed Sagor *ngIf structural Directive <button (click)="show = !show"> {{show ? 'hide' : 'show’}} </button> show = {{show}} <br> <div *ngIf="show; else elseBlock"> Text to show </div> <ng-template #elseBlock> Alternate text while primary text is hidden </ng-template> show: boolean = true;
  • 16. Software IndustrySultan Ahmed Sagor *ngFor structural Directive ❖ The *ngFor directive is used to repeat a portion of HTML template once per each item from an iterable list (Collection). ❖ To Use ngFor directive, you have to create a block of HTML elements, which can display a single item of the items collection. ❖ After that you can use the ngFor directive to tell angular to repeat that block of HTML elements for each item in the list. <li *ngFor="let item of items;"> .... </li>
  • 17. Software IndustrySultan Ahmed Sagor *ngFor structural Directive class Movie { title : string; director : string; cast : string; releaseDate : string; } title: string ="Top 10 Movies" ; movies: Movie[] =[ {title:'Zootopia',director:'Byron Howard, Rich Moor e',cast:'Idris Elba, Ginnifer Goodwin, Jason Bateman',r eleaseDate:'March 4, 2016'}, {title:'Batman v Superman: Dawn of Justice',direct or:'Zack Snyder',cast:'Ben Affleck, Henry Cavill, Amy A dams',releaseDate:'March 25, 2016'}, {title:'Captain America: Civil War',director:'Anthony Russo, Joe Russo',cast:'Scarlett Johansson, Elizabeth Olsen, Chris Evans',releaseDate:'May 6, 2016'}, {title:'X- Men: Apocalypse',director:'Bryan Singer',cast:'Jennifer Lawrence, Olivia Munn, Oscar Isaac',releaseDate:'May 27, 2016'}, ]
  • 18. Software IndustrySultan Ahmed Sagor *ngFor structural Directive <table class='table'> <thead> <tr> <th>Title</th> <th>Director</th> <th>Cast</th> <th>Release Date</th> </tr> </thead> <tbody> <tr *ngFor="let movie of movies;"> <td>{{movie.title}}</td> <td>{{movie.director}}</td> <td>{{movie.cast}}</td> <td>{{movie.releaseDate}}</td> </tr> </tbody> </table> <div class='panel panel-primary'> <div class='panel-heading'> {{title}} </div> <div class='panel-body'> <div class='table-responsive’> </div> </div> </div>
  • 19. Software IndustrySultan Ahmed Sagor *ngSwitch structural Directive ❖ In Angular 8, ngSwitch is a structural directive which is used to Add/Remove DOM Element. ❖ It is similar to switch statement of C#. The ngSwitch directive is applied to the container element with a switch expression. <container_element [ngSwitch]="switch_expression"> <inner_element *ngSwitchCase="match_expresson_1">...</inner_element> <inner_element *ngSwitchCase="match_expresson_2">...</inner_element> <inner_element *ngSwitchCase="match_expresson_3">...</inner_element> <inner_element *ngSwitchDefault>...</element> </container_element>
  • 20. Software IndustrySultan Ahmed Sagor *ngSwitch structural Directive class item { name: string; val: number; } export class AppComponent { items: item[] = [{name: 'One', val: 1}, {name: 'T wo', val: 2}, {name: 'Three', val: 3}]; selectedValue: string= 'One'; } <select [(ngModel)]="selectedValue"> <option *ngFor="let item of items;" [value]="item.na me">{{item.name}}</option> </select> <div class='row' [ngSwitch]="selectedValue"> <div *ngSwitchCase="'One'">One is Pressed</div> <div *ngSwitchCase="'Two'">Two is Selected</div> <div *ngSwitchDefault>Default Option</div> </div>
  • 21. Software IndustrySultan Ahmed Sagor Any question?
  • 22. Software IndustrySultan Ahmed Sagor Thank You