SlideShare a Scribd company logo
Angular 6
Form
Validations BY
SACHINI & MALIKA
SACHINI CHARTHURIKA
Software Engineer @ Ascentic
https://www.linkedin.com/in/sachinichathurika/
MALIKA MUNAWEERA
Software Engineer @ Ascentic
https://www.linkedin.com/in/malikamunaweera/
Agenda
1. Angular 6 Overview.
2. Angular 6 form validation.
 Template driven method.
 Reactive forms method.
3. Add Angular Material to reactive forms
with validations.
4. Advantages and disadvantages
Angular 6 Overview
Released on 4th of May, 2018. Mainly Highlighted new features in
Angular 6:
Angular Command Line Interface (CLI)
The Component Development KIT (CDK)
Angular Material package
Angular Elements
1. Angular 6 fully supports to the Element Package.
2. Allow to use Angular components outside of Angular
like in JQuery or VueJS apps.
3. Can create Angular components and publish them as
Web Components, which can then be used in any
HTML page.
Component Dev Kit (CDK)
1. Released in December of 2017.
2. Can now build your own library of UI components
without using the Angular Material library.
3. Supports Responsive Web Design layouts.
4. CDK includes the @angular/cdk/overlay package.
Command Line Interface (CLI)
Equipped with new commands such as,
ng-update - updates dependencies and code.
ng-add - quickly add application features and supports
to turn applications into progressive web apps.
Allows developers to choose the ng-package for
transpiling different libraries using the Bazel tool.
Other Features
Web Pack Update.
Web pack module bundler has been updated to version4.
Ivy: New Rendering Engine
Expects to increase the speed and decreases the size of the
application.
RxJS 6.0Angular 6 now used RxJS 6 internally.
Provide an increase in performance, easier to debug AJAX call
stacks and improve modularity as backward compatible as
possible.
Earlier
Now
Other Features
Tree Shaking
Angular 6 moved from modules referencing services to
services referencing modules to make the Angular app smaller.
Multiple Validators For Your Forms
Angular 6 now allows you to pass multiple
validators to the formBuilder.
No <template> element and now it’s <ng-
tempalate>.
Best Practices!
Prerequisites
Install Angular CLI 6.
◦NodeJs
◦Npm
◦Beginner level knowledge on
Angular 2/4/5 and HTML.
Template – Driven Form Validation(Demo)
Important Angular CLI
Commands
Create a new project.
ng new validation –routing
Create a new folder and include the required files.
ng g c form-template --spec false
ng g c form-reactive --spec false
Create the compare-validator directive in a shared folder.
ng g d shared/compare-validator --spec false
Run the application locally.
ng serve
Template – Driven Form Validation(Demo)
Different form states that can be used to validate a form:
$untouched - The field has not been touched yet
$touched - The field has been touched
$pristine - The field has not been modified yet
$dirty - The field has been modified
$invalid - The field content is not valid
$valid - The field content is valid
Template – Driven
Form
Validation(Demo)
1. Create a new folder and include the required files.
ng g c form-template --spec false
2. Import BootstrapCDN in styles.css
@import
url(https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/
bootstrap.min.css);
3. Create the compare-validator directive.
ng g d shared/compare-validator --spec false
4. Import forms module to your app module.
import { FormsModule } from '@angular/forms’;
5. HTML page implementation.
6. Configure the app-routings.
Reactive Form Validation (Demo)
Reactive Form
Validation
(Demo)
1. Create a new folder and include the required
files.
ng g c form-reactive --spec false
2. Import the ReactiveFormsModule to the app
module.
3. Create the Reactive form.
4. Change the template driven form to the
reactive form. <form
[formGroup]="reactiveForm">
5. Modify the validation directive.
6. Apply best practices!
Adding Agular Material
& FORM VALIDATIONS WITH MATERIAL
Angular Material
UI component library
Help constructing
◦ attractive,
◦ consistent
◦ functional web pages and web applications
Supports modern web design principles like browser
portability, device independence
Create faster, beautiful, and responsive websites.
Inspired by the Google Material Design.
What’s new with Angular Material
ANGULAR MATERIAL V6
WAS RELEASED ALONG
SIDE ANGULAR 6.
GOING FORWARD MAJOR
RELEASES WILL BE
ALIGNED WITH ANGULAR.
CDK IS NOW A SEPARATE
LIBRARY
ANGULAR MATERIAL
SCHEMATICS
Add Material to
an existing
project (Demo)
Install Angular Material using CDK
◦ This will help you quickly add Material to
a project
◦ Ensure project dependencies in
package.json
◦ Ensure project dependencies in your app
module
◦ Adds Prebuilt or Setup Custom Theme
◦ Adds Roboto fonts to your index.html
◦ Apply simple CSS reset to body
Using starter components
Implementing form validations
With Material (Demo)
Placeholders
Hints
Required fields
Error Messages
Validators
Final Output
Pros & Cons
PROS
With Angular Material you get pre-built
components
Seamless updates using Angular CLI
Powerful ecosystem
CONS
Steep learning curve
Documentation is lacking details
References
 http://jasonwatmore.com/post/2018/05/11/angular-6-template-driven-forms-
validation-example
 http://jasonwatmore.com/post/2018/05/10/angular-6-reactive-forms-
validation-example
 https://material.angular.io
 https://codingthesmartway.com/angular-material-and-angular-6-material-
design-for-angular/
Find the Code
Repository location of Angular 6 form validations
https://github.com/SacheeCG/DevForumAngular6FormVali
dation
Repository location of Angular 6 form validations with
Angular Material.
https://github.com/SacheeCG/DevForumANgular6FormVali
dationwithAngularMaterial
Thank you!

More Related Content

What's hot

Angular Observables & RxJS Introduction
Angular Observables & RxJS IntroductionAngular Observables & RxJS Introduction
Angular Observables & RxJS Introduction
Rahat Khanna a.k.a mAppMechanic
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha Gadkari
Surekha Gadkari
 
How to implement internationalization (i18n) in angular application(multiple ...
How to implement internationalization (i18n) in angular application(multiple ...How to implement internationalization (i18n) in angular application(multiple ...
How to implement internationalization (i18n) in angular application(multiple ...
Katy Slemon
 
Angular Dependency Injection
Angular Dependency InjectionAngular Dependency Injection
Angular Dependency Injection
Nir Kaufman
 
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 - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
WebStackAcademy
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
Emanuele DelBono
 
RxJS & Angular Reactive Forms @ Codemotion 2019
RxJS & Angular Reactive Forms @ Codemotion 2019RxJS & Angular Reactive Forms @ Codemotion 2019
RxJS & Angular Reactive Forms @ Codemotion 2019
Fabio Biondi
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
Varun Raj
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - Components
WebStackAcademy
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
Angular Interview Questions & Answers
Angular Interview Questions & AnswersAngular Interview Questions & Answers
Angular Interview Questions & Answers
Ratnala Charan kumar
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular Components
Squash Apps Pvt Ltd
 
Angular Notes.pdf
Angular Notes.pdfAngular Notes.pdf
Angular Notes.pdf
sagarpal60
 
Demystifying Angular Animations
Demystifying Angular AnimationsDemystifying Angular Animations
Demystifying Angular Animations
Gil Fink
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
Duy Khanh
 
Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete Guide
Sam Dias
 
Angular 14.pptx
Angular 14.pptxAngular 14.pptx
Angular 14.pptx
MohaNedGhawar
 
Angular
AngularAngular
Angular
khoado2002
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
Tariqul islam
 

What's hot (20)

Angular Observables & RxJS Introduction
Angular Observables & RxJS IntroductionAngular Observables & RxJS Introduction
Angular Observables & RxJS Introduction
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha Gadkari
 
How to implement internationalization (i18n) in angular application(multiple ...
How to implement internationalization (i18n) in angular application(multiple ...How to implement internationalization (i18n) in angular application(multiple ...
How to implement internationalization (i18n) in angular application(multiple ...
 
Angular Dependency Injection
Angular Dependency InjectionAngular Dependency Injection
Angular Dependency Injection
 
Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2Routing & Navigating Pages in Angular 2
Routing & Navigating Pages in Angular 2
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
 
RxJS & Angular Reactive Forms @ Codemotion 2019
RxJS & Angular Reactive Forms @ Codemotion 2019RxJS & Angular Reactive Forms @ Codemotion 2019
RxJS & Angular Reactive Forms @ Codemotion 2019
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
Angular - Chapter 3 - Components
Angular - Chapter 3 - ComponentsAngular - Chapter 3 - Components
Angular - Chapter 3 - Components
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Angular Interview Questions & Answers
Angular Interview Questions & AnswersAngular Interview Questions & Answers
Angular Interview Questions & Answers
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular Components
 
Angular Notes.pdf
Angular Notes.pdfAngular Notes.pdf
Angular Notes.pdf
 
Demystifying Angular Animations
Demystifying Angular AnimationsDemystifying Angular Animations
Demystifying Angular Animations
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete Guide
 
Angular 14.pptx
Angular 14.pptxAngular 14.pptx
Angular 14.pptx
 
Angular
AngularAngular
Angular
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 

Similar to Angular 6 Form Validation with Material

Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
Mallikarjuna G D
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
php2ranjan
 
What are The Top Features of Angular 7?
What are The Top Features of Angular 7?What are The Top Features of Angular 7?
What are The Top Features of Angular 7?
NCode Technologies, Inc.
 
Single Page Applications in SharePoint with Angular
Single Page Applications in SharePoint with AngularSingle Page Applications in SharePoint with Angular
Single Page Applications in SharePoint with Angular
Sparkhound Inc.
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
Yakov Fain
 
Angular js getting started
Angular js getting startedAngular js getting started
Angular js getting started
Hemant Mali
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
Suresh Patidar
 
What’s new in angular 13 and why should you use it for web app development pr...
What’s new in angular 13 and why should you use it for web app development pr...What’s new in angular 13 and why should you use it for web app development pr...
What’s new in angular 13 and why should you use it for web app development pr...
Moon Technolabs Pvt. Ltd.
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project Report
Kodexhub
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
Mohamad Al Asmar
 
AngularJS
AngularJSAngularJS
AngularJS
Mahmoud Tolba
 
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.
 
Angular
AngularAngular
angular
angularangular
angular
angularangular
angular content
angular contentangular content
angular content
MUDDUKRISHNA14
 
angular
angularangular
GDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopGDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and Workshop
Drew Morris
 
Why choose Angular 6?
Why choose Angular 6?Why choose Angular 6?
Why choose Angular 6?
Priyanka Verma
 
Say hello world with angular 5
Say hello world with angular 5Say hello world with angular 5
Say hello world with angular 5
Abhishek Mallick
 

Similar to Angular 6 Form Validation with Material (20)

Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
 
What are The Top Features of Angular 7?
What are The Top Features of Angular 7?What are The Top Features of Angular 7?
What are The Top Features of Angular 7?
 
Single Page Applications in SharePoint with Angular
Single Page Applications in SharePoint with AngularSingle Page Applications in SharePoint with Angular
Single Page Applications in SharePoint with Angular
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Angular js getting started
Angular js getting startedAngular js getting started
Angular js getting started
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
 
What’s new in angular 13 and why should you use it for web app development pr...
What’s new in angular 13 and why should you use it for web app development pr...What’s new in angular 13 and why should you use it for web app development pr...
What’s new in angular 13 and why should you use it for web app development pr...
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project Report
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
 
AngularJS
AngularJSAngularJS
AngularJS
 
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
 
Angular
AngularAngular
Angular
 
angular
angularangular
angular
 
angular
angularangular
angular
 
angular content
angular contentangular content
angular content
 
angular
angularangular
angular
 
GDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopGDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and Workshop
 
Why choose Angular 6?
Why choose Angular 6?Why choose Angular 6?
Why choose Angular 6?
 
Say hello world with angular 5
Say hello world with angular 5Say hello world with angular 5
Say hello world with angular 5
 

Recently uploaded

HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 

Recently uploaded (20)

HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 

Angular 6 Form Validation with Material

  • 2. SACHINI CHARTHURIKA Software Engineer @ Ascentic https://www.linkedin.com/in/sachinichathurika/ MALIKA MUNAWEERA Software Engineer @ Ascentic https://www.linkedin.com/in/malikamunaweera/
  • 3. Agenda 1. Angular 6 Overview. 2. Angular 6 form validation.  Template driven method.  Reactive forms method. 3. Add Angular Material to reactive forms with validations. 4. Advantages and disadvantages
  • 4. Angular 6 Overview Released on 4th of May, 2018. Mainly Highlighted new features in Angular 6: Angular Command Line Interface (CLI) The Component Development KIT (CDK) Angular Material package
  • 5. Angular Elements 1. Angular 6 fully supports to the Element Package. 2. Allow to use Angular components outside of Angular like in JQuery or VueJS apps. 3. Can create Angular components and publish them as Web Components, which can then be used in any HTML page.
  • 6. Component Dev Kit (CDK) 1. Released in December of 2017. 2. Can now build your own library of UI components without using the Angular Material library. 3. Supports Responsive Web Design layouts. 4. CDK includes the @angular/cdk/overlay package.
  • 7. Command Line Interface (CLI) Equipped with new commands such as, ng-update - updates dependencies and code. ng-add - quickly add application features and supports to turn applications into progressive web apps. Allows developers to choose the ng-package for transpiling different libraries using the Bazel tool.
  • 8. Other Features Web Pack Update. Web pack module bundler has been updated to version4. Ivy: New Rendering Engine Expects to increase the speed and decreases the size of the application. RxJS 6.0Angular 6 now used RxJS 6 internally. Provide an increase in performance, easier to debug AJAX call stacks and improve modularity as backward compatible as possible.
  • 9. Earlier Now Other Features Tree Shaking Angular 6 moved from modules referencing services to services referencing modules to make the Angular app smaller.
  • 10. Multiple Validators For Your Forms Angular 6 now allows you to pass multiple validators to the formBuilder. No <template> element and now it’s <ng- tempalate>. Best Practices!
  • 11. Prerequisites Install Angular CLI 6. ◦NodeJs ◦Npm ◦Beginner level knowledge on Angular 2/4/5 and HTML.
  • 12. Template – Driven Form Validation(Demo)
  • 13. Important Angular CLI Commands Create a new project. ng new validation –routing Create a new folder and include the required files. ng g c form-template --spec false ng g c form-reactive --spec false Create the compare-validator directive in a shared folder. ng g d shared/compare-validator --spec false Run the application locally. ng serve
  • 14. Template – Driven Form Validation(Demo) Different form states that can be used to validate a form: $untouched - The field has not been touched yet $touched - The field has been touched $pristine - The field has not been modified yet $dirty - The field has been modified $invalid - The field content is not valid $valid - The field content is valid
  • 15. Template – Driven Form Validation(Demo) 1. Create a new folder and include the required files. ng g c form-template --spec false 2. Import BootstrapCDN in styles.css @import url(https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/ bootstrap.min.css); 3. Create the compare-validator directive. ng g d shared/compare-validator --spec false 4. Import forms module to your app module. import { FormsModule } from '@angular/forms’; 5. HTML page implementation. 6. Configure the app-routings.
  • 17. Reactive Form Validation (Demo) 1. Create a new folder and include the required files. ng g c form-reactive --spec false 2. Import the ReactiveFormsModule to the app module. 3. Create the Reactive form. 4. Change the template driven form to the reactive form. <form [formGroup]="reactiveForm"> 5. Modify the validation directive. 6. Apply best practices!
  • 18. Adding Agular Material & FORM VALIDATIONS WITH MATERIAL
  • 19. Angular Material UI component library Help constructing ◦ attractive, ◦ consistent ◦ functional web pages and web applications Supports modern web design principles like browser portability, device independence Create faster, beautiful, and responsive websites. Inspired by the Google Material Design.
  • 20. What’s new with Angular Material ANGULAR MATERIAL V6 WAS RELEASED ALONG SIDE ANGULAR 6. GOING FORWARD MAJOR RELEASES WILL BE ALIGNED WITH ANGULAR. CDK IS NOW A SEPARATE LIBRARY ANGULAR MATERIAL SCHEMATICS
  • 21. Add Material to an existing project (Demo) Install Angular Material using CDK ◦ This will help you quickly add Material to a project ◦ Ensure project dependencies in package.json ◦ Ensure project dependencies in your app module ◦ Adds Prebuilt or Setup Custom Theme ◦ Adds Roboto fonts to your index.html ◦ Apply simple CSS reset to body Using starter components
  • 22. Implementing form validations With Material (Demo) Placeholders Hints Required fields Error Messages Validators
  • 25. PROS With Angular Material you get pre-built components Seamless updates using Angular CLI Powerful ecosystem CONS Steep learning curve Documentation is lacking details
  • 27. Find the Code Repository location of Angular 6 form validations https://github.com/SacheeCG/DevForumAngular6FormVali dation Repository location of Angular 6 form validations with Angular Material. https://github.com/SacheeCG/DevForumANgular6FormVali dationwithAngularMaterial

Editor's Notes

  1. All three are shipped as part of Angular 6, not separate updates. This version release is more focused on the tooling and support rather than the whole framework.
  2. Turning a component into a custom element gives you an easy path for creating dynamic HTML content for your Angular app, and, using the Angular Elements package, it is even easier to create native custom elements.
  3. 1. The Angular Team has made some really neat improvements to it for the 6th version. 2. So you don't have to use other libraries like Flex Layout or even learn using the CSS Grid. It covers them all. 3. This one has a new positioning logic that makes your pop-ups stay on screen very brilliantly.
  4. Without the Bazel tool, you would have to build and package libraries yourself.
  5. Ivy: This important feature is not completely released in Angular 6 since it is in experimental mode; except the complete version in Angular's next release.
  6. All services of the application as well as those of libraries have always been bundled – regardless of whether they were used or not. Tree shaking is a build optimization step which tries to ensure any unused code does not get used in our final bundle.
  7. The <template> element was depreciated one year ago when Angular 4 was launched.
  8. A public content delivery network. Users of BootstrapCDN can load CSS, JavaScript and images remotely, from its servers
  9. Ivy: This important feature is not completely released in Angular 6 since it is in experimental mode; except the complete version in Angular's next release.