SlideShare a Scribd company logo
HQ Dev Team: Ala Gamal Al-Shargabi ‱Ivan Peh
KnockOutJS vs AngularJS
How the topic
come around

SecureSite
(KnockoutJS – 2.1)
HQ
(recently migrated to
Angular 1.3)
We want to share it
with you!
How it all begin

Before we start..
SIMILARITIES
Both are great JS library to
create rich and responsive UI.
Both can be integrated
reasonably easy with 3rd party
components/frameworks
Screwdriver
VS
Tool box
A data-binding solution
framework which will
allow the application
structure to be entirely up
to you.
A full fledged framework,
which allows you to build a
whole web application with
Angular and only Angular.
As it offers a lot of built-in
features.
COMPARING FEATURES
Data Binding
Let’s have a look at how data binding is done for both libraries, we
will assume that out underlying model is this:
Data Binding
Let’s see how to declare and apply bindings in
HTML using both libraries:
Data Binding
SHUT UP &
SHOW ME THE CODE!!
Fine Fine...Jeez!
Validation
If there’s one thing that
takes probably most of the
work when building forms,
it’s validation.
Form validation
Angular
The usual
suspects -
Attributes
Angular
Input type
Built-In Form Validation
Built-in validations are nice, but in
some cases we need validations that
go far beyond the basic functionality
we get out of the box.
And this is where custom validations
come in.
PRIOR TO 1.3
HALF – BAKED ??
$formatters and $parsers
In versions before 1.3, we were able to
implement custom validations by using:
$formatters and $parsers
Designed to convert the view value
into a different model value.
for converting the model value into
the appropriate view value.
What ??
Model
HTML
View
CSS
Controller
Browser
Example
Angular internally handles date
based input elements.
The view value (entered by the
user) is a string based value,
but when it reaches the scope
the value itself is an instance
of Date.
parser Example
Example
Formatters work in the opposite
way. So if we wanted to convert a
date to a properly formatted
string.
So, it is a model to view update.
formatter Example
Meet the $validators pipeline
Angular 1.3 introduces yet another pipeline, the
$validators pipeline, which is rather used than $parsers
+ $formatters.
Unlike parsers and formatters, the validators pipeline
has access to both, viewValue and modelValue, once
$parsers and $formatters has been successfully run.
The validation pipeline
has been added to the
existing pipeline. It is
basically there, so
developers can explicitly
distinguish between
validations and
parsing/formatting related
functionality.
$validators is not an array,
but an object with each
member describing a
validator.
An Improvement
#speakgeek - Angular JS
ASYNCHRONOUS VALIDATION
With 1.3, Angular makes asynchronous validations
possible.
For e.g. Imagine the case you have an input field
for a user name and whenever a user types in a
name, you need to perform some validity checks
on your server. The application needs to wait until
the server responses.
#speakgeek - Angular JS
$asyncValidators
Asynchronous validators
work pretty much like
synchronous validators
except that they are
asynchronous and therefore
promise based.
Instead of returning
true or false, we return
a promise that holds the
state of an asynchronous
code execution.
When the promise fulfills itself then the validation is
successful and when it rejects then a validation error is
registered.
Keep in MIND!!
Asynchronous validations
will NOT run unless all of
the prior normal
validators (the validators
present inside of
ngModel.$validators)
have passed.
One thing 

This restriction allows for
the developer (yes you)
to prevent the validator
from making excessive
backend calls when the
input data is invalid.
validators Example
Only once all of the
normal validators and
the async validators
have successfully
passed then the model
value will be written to
the scope.
YES! YES! YES!
ANGULARJS ?
OUR TAKE
‱ Pure SPA is evil.
‱ Being the screwdriver that is it,
KnockOut has a lot of bundled
plugins to support the missing parts
of the puzzle.
‱ KnockOut has higher learning curve
(blessing in disguise).
‱ KnockOut is great for fast
development from scratch.
‱Angular has much more testability.
‱More structured and best Practices
mainly due to wider adoption.
‱ Angular breaks change.
Question ? ?
THANK YOU

More Related Content

PPTX
AngularJS Scopes
PPTX
React js
PPTX
What are the components in React?
PDF
Integrating consumers IoT devices into Business Workflow
PDF
RESTful services and OAUTH protocol in IoT
PPTX
The A1 "AngularJS 1 Kick Start"
PPTX
Dive into Angular, part 4: Angular 2.0
PPTX
BDD approach with Selenium RC
AngularJS Scopes
React js
What are the components in React?
Integrating consumers IoT devices into Business Workflow
RESTful services and OAUTH protocol in IoT
The A1 "AngularJS 1 Kick Start"
Dive into Angular, part 4: Angular 2.0
BDD approach with Selenium RC

What's hot (20)

PDF
Angular 4 for Java Developers
PPTX
React js
PPTX
Bdd with Cucumber and Mocha
PDF
AngularJS - introduction & how it works?
PPTX
Introduction to Angular JS
PPTX
Angular 4
PDF
Ng talk
PDF
Redux and context api with react native app introduction, use cases, implemen...
PPTX
PPTX
Dive into Angular, part 1: Introduction
PPT
Intro to Service Worker API and its use cases
PPTX
Dive into Angular, part 5: Experience
PPTX
Angular 4 - quick view
PPTX
Dive into Angular, part 3: Performance
PDF
Angular2 Development for Java developers
PPTX
AngularJS 2.0
PDF
Angular - Chapter 1 - Introduction
PDF
Type script for_java_dev_jul_2020
PPTX
Dive into Angular, part 2: Architecture
PPTX
Creating custom Validators on Reactive Forms using Angular 6
Angular 4 for Java Developers
React js
Bdd with Cucumber and Mocha
AngularJS - introduction & how it works?
Introduction to Angular JS
Angular 4
Ng talk
Redux and context api with react native app introduction, use cases, implemen...
Dive into Angular, part 1: Introduction
Intro to Service Worker API and its use cases
Dive into Angular, part 5: Experience
Angular 4 - quick view
Dive into Angular, part 3: Performance
Angular2 Development for Java developers
AngularJS 2.0
Angular - Chapter 1 - Introduction
Type script for_java_dev_jul_2020
Dive into Angular, part 2: Architecture
Creating custom Validators on Reactive Forms using Angular 6
Ad

Similar to #speakgeek - Angular JS (20)

PDF
The A1 by Christian John Felix
PPTX
Intoduction to Angularjs
PDF
AngularJS Beginner Day One
PDF
What are the reasons behind growing popularity of AngularJS.pdf
DOCX
AngularJS
PPT
Top java script frameworks ppt
PPTX
Angular interview questions
PDF
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
PPTX
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
PPTX
Angular
PDF
Comparison Between React Vs Angular.pdf
PPSX
PDF
AngularJS - A JavaScript Framework
PDF
Modern webtechnologies
PDF
Introduction To Angular.js - SpringPeople
PPTX
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
PPTX
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
PDF
AngularJS in practice
PDF
Moving from selenium to protractor for test automation
PDF
Angular Project Report
The A1 by Christian John Felix
Intoduction to Angularjs
AngularJS Beginner Day One
What are the reasons behind growing popularity of AngularJS.pdf
AngularJS
Top java script frameworks ppt
Angular interview questions
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
Angular
Comparison Between React Vs Angular.pdf
AngularJS - A JavaScript Framework
Modern webtechnologies
Introduction To Angular.js - SpringPeople
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
AngularJS in practice
Moving from selenium to protractor for test automation
Angular Project Report
Ad

More from Derek Chan (7)

PPTX
#speakgeek - Support Processes for iconnect360
PPTX
#speakgeek - Testing Recipe: The iconnect360 Way
PPTX
#speakgeek - Open Source Software Infrastructure at iconnect360
PPTX
#speakgell - Continuous Integration in iconnect360
PPTX
#speakgeek - Pragmatic Batch Process Management & Developer Testing
PPTX
#speakgeek - Keynote
PPTX
#speakgeek - Agile development in iconnect360
#speakgeek - Support Processes for iconnect360
#speakgeek - Testing Recipe: The iconnect360 Way
#speakgeek - Open Source Software Infrastructure at iconnect360
#speakgell - Continuous Integration in iconnect360
#speakgeek - Pragmatic Batch Process Management & Developer Testing
#speakgeek - Keynote
#speakgeek - Agile development in iconnect360

Recently uploaded (20)

PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
System and Network Administration Chapter 2
PPTX
Introduction to Artificial Intelligence
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Understanding Forklifts - TECH EHS Solution
PDF
top salesforce developer skills in 2025.pdf
PPT
Introduction Database Management System for Course Database
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
AI in Product Development-omnex systems
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PTS Company Brochure 2025 (1).pdf.......
System and Network Administration Chapter 2
Introduction to Artificial Intelligence
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Operating system designcfffgfgggggggvggggggggg
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Understanding Forklifts - TECH EHS Solution
top salesforce developer skills in 2025.pdf
Introduction Database Management System for Course Database
Softaken Excel to vCard Converter Software.pdf
Odoo POS Development Services by CandidRoot Solutions
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Which alternative to Crystal Reports is best for small or large businesses.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
ISO 45001 Occupational Health and Safety Management System
AI in Product Development-omnex systems
Odoo Companies in India – Driving Business Transformation.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf

#speakgeek - Angular JS

  • 1. HQ Dev Team: Ala Gamal Al-Shargabi ‱Ivan Peh KnockOutJS vs AngularJS
  • 2. How the topic come around
 SecureSite (KnockoutJS – 2.1) HQ (recently migrated to Angular 1.3) We want to share it with you!
  • 3. How it all begin

  • 6. Both are great JS library to create rich and responsive UI. Both can be integrated reasonably easy with 3rd party components/frameworks
  • 7. Screwdriver VS Tool box A data-binding solution framework which will allow the application structure to be entirely up to you. A full fledged framework, which allows you to build a whole web application with Angular and only Angular. As it offers a lot of built-in features.
  • 9. Data Binding Let’s have a look at how data binding is done for both libraries, we will assume that out underlying model is this:
  • 10. Data Binding Let’s see how to declare and apply bindings in HTML using both libraries:
  • 12. SHUT UP & SHOW ME THE CODE!! Fine Fine...Jeez!
  • 13. Validation If there’s one thing that takes probably most of the work when building forms, it’s validation. Form validation
  • 16. Built-In Form Validation Built-in validations are nice, but in some cases we need validations that go far beyond the basic functionality we get out of the box. And this is where custom validations come in.
  • 17. PRIOR TO 1.3 HALF – BAKED ??
  • 18. $formatters and $parsers In versions before 1.3, we were able to implement custom validations by using: $formatters and $parsers Designed to convert the view value into a different model value. for converting the model value into the appropriate view value.
  • 20. Example Angular internally handles date based input elements. The view value (entered by the user) is a string based value, but when it reaches the scope the value itself is an instance of Date. parser Example
  • 21. Example Formatters work in the opposite way. So if we wanted to convert a date to a properly formatted string. So, it is a model to view update. formatter Example
  • 22. Meet the $validators pipeline Angular 1.3 introduces yet another pipeline, the $validators pipeline, which is rather used than $parsers + $formatters. Unlike parsers and formatters, the validators pipeline has access to both, viewValue and modelValue, once $parsers and $formatters has been successfully run.
  • 23. The validation pipeline has been added to the existing pipeline. It is basically there, so developers can explicitly distinguish between validations and parsing/formatting related functionality. $validators is not an array, but an object with each member describing a validator. An Improvement
  • 26. With 1.3, Angular makes asynchronous validations possible. For e.g. Imagine the case you have an input field for a user name and whenever a user types in a name, you need to perform some validity checks on your server. The application needs to wait until the server responses.
  • 28. $asyncValidators Asynchronous validators work pretty much like synchronous validators except that they are asynchronous and therefore promise based. Instead of returning true or false, we return a promise that holds the state of an asynchronous code execution.
  • 29. When the promise fulfills itself then the validation is successful and when it rejects then a validation error is registered.
  • 30. Keep in MIND!! Asynchronous validations will NOT run unless all of the prior normal validators (the validators present inside of ngModel.$validators) have passed.
  • 31. One thing 
 This restriction allows for the developer (yes you) to prevent the validator from making excessive backend calls when the input data is invalid. validators Example Only once all of the normal validators and the async validators have successfully passed then the model value will be written to the scope.
  • 34. ‱ Pure SPA is evil. ‱ Being the screwdriver that is it, KnockOut has a lot of bundled plugins to support the missing parts of the puzzle. ‱ KnockOut has higher learning curve (blessing in disguise). ‱ KnockOut is great for fast development from scratch.
  • 35. ‱Angular has much more testability. ‱More structured and best Practices mainly due to wider adoption. ‱ Angular breaks change.