Both React and AngularJS are JavaScript (JS) technologies used for developing single-page applications (SPAs).Angular is developed by Google while React is developed by Facebook.
Architecture
React is just a library for developing UIs while Angular is a JavaScript framework.Angular implements the MVC architecture.
Angular applications typically have three different components
- Model
- View
- Controller
React on the other hand is used to create just the view.
Data Binding
Angular supports two way data binding while React supports one way data binding.
Angular supports change management using watcher.There is a watcher created for each binding.For each change in the UI all the watchers are executed by the digest loop.This has severe performance penalty.
React on the other hand uses server side rendering and Virtual DOM. DOM which consists of JavaScript objects is created on the server.
When a value on the UI element changes only the HTML for that changed element is sent to the browser instead of complete HTML.
Language
AngularJS applications are written in JavaScript.Angular version 2 and above applications can be developed using TypeScript or Dart.This gives a huge advantage to developers since TypeScript provides lot of features not available in JavaScript.
React components are written in JSX, which is language which runs on browsers.It is a statically-typed, object-oriented programming language.
Mobile development
In the case of React it is React Native, which allows native Android, iOS development with React.Angular 2 can be used with Ionic 2 to develop mobile applications.
Learning Curve
Since it is a framework and Angular applications follows the MVC architecture ,Angular has a steep learning curve compared to React which is just a library for developing User Interface.
Leave a Reply