SlideShare a Scribd company logo
AngularJS vs. 
Facebook React 
David Pohan a Standa Jaša
Today’s Agenda 
1. Obecně Angular vs React 
2. Hello World 
3. Nahrání partialu stránky 
4. Todo aplikace 
5. Literatura a bitka
Motivace 
“Miško Hevery (autor Angularu) se vsadil o $10k, že 
přepíše 
DoubleClick z 19 tis. loc v GWT 
na 1700 loc v angularu za 14 dní.” 
(Nakonec to trvalo tři týdny.)
Angular vs React (obecně) 
● V Googlu ~ 1200 
aplikací 
● HTML tagy 
● Testování ~ docs 
● Two-way 
databinding 
● AngularDart 
● Sublime + Idea OK 
● JSX skript 
● Virtuální dom -> 
update pomocí diffu 
● One-way reactive 
data flow
Hello World 
<html ng-app> 
<head><script src=”angular.js” 
></script> 
</head><body> 
<input ng-model=”name” 
placeholder=”your name”> 
<h1>Hello {{name}}</h1> 
</body></html> 
<script type=”text/jsx”> 
var HelloMessage = React.createClass({ 
render: function() { 
return <div>Hello {this.props.name} 
</div>; 
} 
}); 
React.render(<HelloMessage name=" 
John" />, mountNode); 
</script>
Nahrání partialu - routing v Angularu 
// partial.html------------------------------- 
<div>param: {{params.bookId}}</div> 
// index.html-------------------------------- 
<div ng-controller=”MainController”> 
<a href=”Book/Gatsby”>Gatsby</a> 
<div ng-view></div> 
</div> 
// script.js----------------------------------- 
angular.module(‘ngRouteExample’, 
[‘ngRoute’]) 
.controller(‘MainController’, function 
($scope, $route) { 
$scope.$route = $route; 
}) 
.controller(‘BookController’, function 
($scope, $routeParams) { 
$scope.params = $routeParams;}) 
.config(function($routeProvider) { 
$routeProvider.when(‘/Book/:bookId’, 
{ templateUrl: ‘partial.html’, 
controller: ‘BookController’});
ToDo aplikace 
<div ng-controller=”TodoController”> 
<ul><li ng-repeat=”todo in todos”> 
{{todo}}</li></ul> 
</div> 
<script>angular.module(‘todoApp’, []) 
.controller(‘TodoController’, [‘$scope’, 
function ($scope) { 
$scope.todos = [‘todo1’, ‘todo2’, …]; 
}]);</script> 
<script type=”text/jsx”> 
var TodoList = React.createClass({ 
render: function() { 
var createItem = function(itemText) { 
return <li>{itemText}</li>; 
}; 
return <ul>{this.props.items.map(createItem)}</ul>; 
} 
}); 
var TodoApp = React.createClass({ 
getInitialState: function() { 
return {items: [], text: ''}; 
}, 
onChange: function(e) { 
this.setState({text: e.target.value}); 
}, 
handleSubmit: function(e) { 
e.preventDefault(); 
var nextItems = this.state.items.concat([this.state.text]);
Bonus pro Viktora (a zbytek hate party) 
angular.noop 
- function in module ng 
A function that performs no 
operations. This function can be 
useful when writing code in the 
functional style. 
function foo(callback) { 
var result = calculateResult(); 
(callback || angular.noop)(result); 
} 
WTF?
Literatúra 
● https://www.youtube.com/watch? 
v=tnXO-i7944M 
(Angular in 20 mins) 
● https://www.youtube.com/watch? 
v=M-MuOU3My-Y 
(Vojta Jína v Liberci) 
● http://facebook.github. 
io/react/docs/tutorial.html 
(úvodní tutorial) 
● http://facebook.github. 
io/react/docs/thinking-in-react. 
html 
(filosofie Reactu) 
● http://facebook.github. 
io/flux/docs/overview.html 
(Flux architekura)

More Related Content

What's hot (20)

PDF
Gettings started with the superheroic JavaScript library AngularJS
Armin Vieweg
 
PDF
React.js触ってみた 吉澤和香奈
Wakana Yoshizawa
 
PDF
Introduction to AngularJS
Jussi Pohjolainen
 
PDF
The Complementarity of React and Web Components
Andrew Rota
 
PDF
AngularJS - What is it & Why is it awesome ? (with demos)
Gary Arora
 
PDF
AngularJS best-practices
Henry Tao
 
PDF
AngularJS Deep Dives (NYC GDG Apr 2013)
Nitya Narasimhan
 
PDF
AngularJS Basics
Ravi Mone
 
PPTX
Introduction to Angularjs
Manish Shekhawat
 
PDF
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
PDF
Introduction to AJAX In WordPress
Caldera Labs
 
PPTX
AngularJS Beginners Workshop
Sathish VJ
 
PDF
AngularJS application architecture
Gabriele Falace
 
PPTX
Javascript first-class citizenery
toddbr
 
PPTX
Angular js tutorial slides
samhelman
 
PPTX
Why angular js Framework
Sakthi Bro
 
PPTX
Angular JS - Introduction
Sagar Acharya
 
PDF
JS Chicago Meetup 2/23/16 - Redux & Routes
Nick Dreckshage
 
PPTX
AngularJS - Architecture decisions in a large project 
Elad Hirsch
 
PDF
React Fundamentals - Jakarta JS, Apr 2016
Simon Sturmer
 
Gettings started with the superheroic JavaScript library AngularJS
Armin Vieweg
 
React.js触ってみた 吉澤和香奈
Wakana Yoshizawa
 
Introduction to AngularJS
Jussi Pohjolainen
 
The Complementarity of React and Web Components
Andrew Rota
 
AngularJS - What is it & Why is it awesome ? (with demos)
Gary Arora
 
AngularJS best-practices
Henry Tao
 
AngularJS Deep Dives (NYC GDG Apr 2013)
Nitya Narasimhan
 
AngularJS Basics
Ravi Mone
 
Introduction to Angularjs
Manish Shekhawat
 
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
Introduction to AJAX In WordPress
Caldera Labs
 
AngularJS Beginners Workshop
Sathish VJ
 
AngularJS application architecture
Gabriele Falace
 
Javascript first-class citizenery
toddbr
 
Angular js tutorial slides
samhelman
 
Why angular js Framework
Sakthi Bro
 
Angular JS - Introduction
Sagar Acharya
 
JS Chicago Meetup 2/23/16 - Redux & Routes
Nick Dreckshage
 
AngularJS - Architecture decisions in a large project 
Elad Hirsch
 
React Fundamentals - Jakarta JS, Apr 2016
Simon Sturmer
 

Viewers also liked (20)

PDF
Angular 2 vs React. What to chose in 2017?
TechMagic
 
PDF
Angular 2 vs React
Iran Reyes Fleitas
 
PDF
ReactJS vs AngularJS - Head to Head comparison
500Tech
 
PPTX
React Vs AnagularJS
deepakpatil84
 
PDF
React vs angular
500Tech
 
PPTX
Web development at Live: Frontend Software Intro + Trade-offs, React, Angular
Amy Hua
 
PDF
React vs angular (mobile first battle)
Michael Haberman
 
PDF
El combate del siglo: AngularJS vs ReactJS
SlashMobility.com
 
PDF
ReactJS or Angular
boyney123
 
PDF
AngularJS + React
justvamp
 
PDF
Thinking in Components
Anton Ivanov
 
PPTX
Online Spreadsheet for your Web Applications using Kendo UI
Lohith Goudagere Nagaraj
 
PPTX
Introduction to React JS
Lohith Goudagere Nagaraj
 
PDF
Angular js o React? Spunti e idee per la scelta di un framework
Giovanni Buffa
 
ODP
Springboot and camel
Deepak Kumar
 
PDF
Back to the future: Isomorphic javascript applications
Luciano Colosio
 
PDF
前端技術大亂鬥
Casear Chu
 
PDF
Crossing platforms with JavaScript & React
Robert DeLuca
 
PDF
Toolkit of modern web development (DevFest Košice 7.5.2016)
jskvara
 
PDF
Succeeding with Agile
Mike Cohn
 
Angular 2 vs React. What to chose in 2017?
TechMagic
 
Angular 2 vs React
Iran Reyes Fleitas
 
ReactJS vs AngularJS - Head to Head comparison
500Tech
 
React Vs AnagularJS
deepakpatil84
 
React vs angular
500Tech
 
Web development at Live: Frontend Software Intro + Trade-offs, React, Angular
Amy Hua
 
React vs angular (mobile first battle)
Michael Haberman
 
El combate del siglo: AngularJS vs ReactJS
SlashMobility.com
 
ReactJS or Angular
boyney123
 
AngularJS + React
justvamp
 
Thinking in Components
Anton Ivanov
 
Online Spreadsheet for your Web Applications using Kendo UI
Lohith Goudagere Nagaraj
 
Introduction to React JS
Lohith Goudagere Nagaraj
 
Angular js o React? Spunti e idee per la scelta di un framework
Giovanni Buffa
 
Springboot and camel
Deepak Kumar
 
Back to the future: Isomorphic javascript applications
Luciano Colosio
 
前端技術大亂鬥
Casear Chu
 
Crossing platforms with JavaScript & React
Robert DeLuca
 
Toolkit of modern web development (DevFest Košice 7.5.2016)
jskvara
 
Succeeding with Agile
Mike Cohn
 
Ad

More from Keyup (20)

PDF
Unity
Keyup
 
PDF
Google AdWords a Google AdSense vs. AdBlock.
Keyup
 
PDF
WinJS
Keyup
 
PDF
Redux+React
Keyup
 
PDF
Garbage Collection in Java
Keyup
 
PDF
CSS flexbox
Keyup
 
PDF
Magento 2
Keyup
 
PDF
Silex
Keyup
 
PPTX
Ruby on rails
Keyup
 
PPTX
HHVM & Hack
Keyup
 
PPTX
Icinga2
Keyup
 
PPTX
O auth2
Keyup
 
PDF
Úvod do bezpečnosti na webu
Keyup
 
PPTX
CoffeeScript
Keyup
 
PDF
Easymock
Keyup
 
PPTX
CSS 3
Keyup
 
PDF
Contract in Java
Keyup
 
PDF
Jenkins
Keyup
 
ODP
JLint
Keyup
 
PDF
Optimalizace rychlosti stránek
Keyup
 
Unity
Keyup
 
Google AdWords a Google AdSense vs. AdBlock.
Keyup
 
WinJS
Keyup
 
Redux+React
Keyup
 
Garbage Collection in Java
Keyup
 
CSS flexbox
Keyup
 
Magento 2
Keyup
 
Silex
Keyup
 
Ruby on rails
Keyup
 
HHVM & Hack
Keyup
 
Icinga2
Keyup
 
O auth2
Keyup
 
Úvod do bezpečnosti na webu
Keyup
 
CoffeeScript
Keyup
 
Easymock
Keyup
 
CSS 3
Keyup
 
Contract in Java
Keyup
 
Jenkins
Keyup
 
JLint
Keyup
 
Optimalizace rychlosti stránek
Keyup
 
Ad

Recently uploaded (20)

PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 

Angular js vs. Facebook react

  • 1. AngularJS vs. Facebook React David Pohan a Standa Jaša
  • 2. Today’s Agenda 1. Obecně Angular vs React 2. Hello World 3. Nahrání partialu stránky 4. Todo aplikace 5. Literatura a bitka
  • 3. Motivace “Miško Hevery (autor Angularu) se vsadil o $10k, že přepíše DoubleClick z 19 tis. loc v GWT na 1700 loc v angularu za 14 dní.” (Nakonec to trvalo tři týdny.)
  • 4. Angular vs React (obecně) ● V Googlu ~ 1200 aplikací ● HTML tagy ● Testování ~ docs ● Two-way databinding ● AngularDart ● Sublime + Idea OK ● JSX skript ● Virtuální dom -> update pomocí diffu ● One-way reactive data flow
  • 5. Hello World <html ng-app> <head><script src=”angular.js” ></script> </head><body> <input ng-model=”name” placeholder=”your name”> <h1>Hello {{name}}</h1> </body></html> <script type=”text/jsx”> var HelloMessage = React.createClass({ render: function() { return <div>Hello {this.props.name} </div>; } }); React.render(<HelloMessage name=" John" />, mountNode); </script>
  • 6. Nahrání partialu - routing v Angularu // partial.html------------------------------- <div>param: {{params.bookId}}</div> // index.html-------------------------------- <div ng-controller=”MainController”> <a href=”Book/Gatsby”>Gatsby</a> <div ng-view></div> </div> // script.js----------------------------------- angular.module(‘ngRouteExample’, [‘ngRoute’]) .controller(‘MainController’, function ($scope, $route) { $scope.$route = $route; }) .controller(‘BookController’, function ($scope, $routeParams) { $scope.params = $routeParams;}) .config(function($routeProvider) { $routeProvider.when(‘/Book/:bookId’, { templateUrl: ‘partial.html’, controller: ‘BookController’});
  • 7. ToDo aplikace <div ng-controller=”TodoController”> <ul><li ng-repeat=”todo in todos”> {{todo}}</li></ul> </div> <script>angular.module(‘todoApp’, []) .controller(‘TodoController’, [‘$scope’, function ($scope) { $scope.todos = [‘todo1’, ‘todo2’, …]; }]);</script> <script type=”text/jsx”> var TodoList = React.createClass({ render: function() { var createItem = function(itemText) { return <li>{itemText}</li>; }; return <ul>{this.props.items.map(createItem)}</ul>; } }); var TodoApp = React.createClass({ getInitialState: function() { return {items: [], text: ''}; }, onChange: function(e) { this.setState({text: e.target.value}); }, handleSubmit: function(e) { e.preventDefault(); var nextItems = this.state.items.concat([this.state.text]);
  • 8. Bonus pro Viktora (a zbytek hate party) angular.noop - function in module ng A function that performs no operations. This function can be useful when writing code in the functional style. function foo(callback) { var result = calculateResult(); (callback || angular.noop)(result); } WTF?
  • 9. Literatúra ● https://www.youtube.com/watch? v=tnXO-i7944M (Angular in 20 mins) ● https://www.youtube.com/watch? v=M-MuOU3My-Y (Vojta Jína v Liberci) ● http://facebook.github. io/react/docs/tutorial.html (úvodní tutorial) ● http://facebook.github. io/react/docs/thinking-in-react. html (filosofie Reactu) ● http://facebook.github. io/flux/docs/overview.html (Flux architekura)