Angular Features: Advantages:
Angularjs is a complete set of frameworks, angular has its own data binding, rendering, Angularui Library, $directive, $service, $q (defer), $route, $http, $cookie ..., etc. a series of tools, Basically, if you're doing web development, it has one. But these things are not react themselves.
Angularjs's structure is clear, the Division of labor is clear, the expansion is good , Model,view,controller who does what when to say very clearly, angular can let the programmer really focus on business logic, JS ability requirements are not high (basically only need to write business logic, really do not have those advanced JS skills and knowledge AH), and because the HTML intrusion is not big, very easy and designer collaboration. The whole frame is full of Di ideas, the coupling is very low , the objects are inject, which means that each object can be easily replaced without affecting other objects.
Angular high productivity, unidirectional data flow What's the idea is very good, but it is too cumbersome to write! I just want to change a very simple data also go through action, dispatcher, store, view four steps, angular in a line of code to do things in react is so troublesome
Angular behind is Google, so the community base is not to worry about, the whole ecology is already very complete, from the most basic tutorial to StackOverflow problem number to the framework of the analysis of itself is very much, angular to get started relatively easy.
Disadvantage:
1. Performance
The same TODO MVC sample,angular fully loaded with 1.1s (Webpagetest-visual Comparison). React only used 0.3s, have to say, really very slow.
2. Angular 2.0 overturn redo makes it inappropriate to adopt this framework at present
Angular 1.x version is actually a relatively old thing, and now it seems that some ideas out of date, such as dependency injection, their own unique modularity, these things in fact under the ES6 has been well solved.
Angular's 2.0 is almost an overturn of the redo frame, it is estimated that there will be no 1.X upgrade scheme. So it would be an awkward time to start a new project with angular. Similarly, such a big change seems to confirm the negative 1. X is not that good.
React Features: Advantages:
The great thing about 1.React is that it puts forward the novel idea of virtual DOM, and this idea derives from react Native, which is likely to unify web/native development. On the performance side, because of the virtual DOM technique, Reactjs only updates the DOM when calling SetState, and updates the virtual DOM first, then compares the actual DOM with the actual DOM. This process compared to the Angularjs bind method, one is to update the DOM less times, the second is to update the content of the DOM less, the speed is certainly fast .
2.ReactJS more attention to the UI component, and the one-way update of the data, proposed a new concept of flux architecture, now react can be directly with the JS ES6 syntax, and then Webpack compiled into a browser-compatible ES5, development efficiency has some advantages.
React native generated by the app is not run on WebView, but the system native Ui,react through JSX generation system native Ui,ios and Android React UI components or similar, a lot of code can be reused
3. Maintain the state of the UI, Angular is used in the $scope, in the React is used this.setstate. The advantage of React is that it is simpler and more intuitive. All state changes have only one entry this.setstate (), Angular is more complex and does not know what black magic is used behind it.
Disadvantage:
React is a target UI component that can often be used in combination with other frameworks and is not currently suitable for a single complete framework. React even with the combination of Flux, can not be called a complete framework, such as you want to use promise Ajax? I'm sorry no, I'm looking for a ready-made library. and third-party components far less than angular. At present in the big stable project to adopt react, I also only know has Yahoo's email. React itself is just a V, so if a large project wants a complete set of frameworks, it may also be necessary to introduce flux and route-related things. and angular offers more than react in this respect.
How to choose? Angular is the real chatty framework, it has a set of ecological systems and ideas, basic you follow its ideas to fill in the code on the OK.
React is a short, powerful library that is only responsible for solving one of your single "pain points." To develop large projects or more formal projects, it is recommended that you use Angular,angular as the best application for the Crud Spa single page. and Angularui together can build a good web App.yeoman+bower+gulp can quickly put up the shelves, after all, relatively simple and practical. For mobile, react has more potential than angular, Reactjs modular + vdom + search-friendly, lightweight and efficient.
Comparison of Angularjs and Reactjs