Recently react on GitHub has a tendency to catch up with angular, have to say that the front-end technology is really changing, compared to Java C # PHP and other old back-end language, JavaScript library life cycle is constantly being shortened and not challenged, It's only been a few years since angular was released, and it really makes people sigh.
There have been attempts to compare react with angular on the internet, as compared to Facebook and Google, both of which are equally well known, but clearly not the same.
As far as my personal feelings are concerned, react is undoubtedly a UI-component solution, and the webcomponent of react and current drafts from a design perspective is obviously not the same, Speaking of Webcomponent will have to mention big change angular2.0, although angular team claimed that ANGULAR2 use typescript is not necessary, but from the official online quick to see, not so, It is estimated that angular2.0 does not have the same great repercussions as angular, and does not have a significant relationship with the direct use of JavaScript. Especially the Typescript module system, although the syntax and ES6, but in fact, but must use the TS own package management library, Microsoft's stuff is such a pain. It's obviously not a solution compared to react,webcp, at least not enough to encapsulate the UI components, whether it's a shadowdom or import template and a custom label, but there's no set of scenarios to integrate it. Although FB flux is not so acceptable, this is not a one-way data flow error, but compared to the idea of MVC, flux obviously pain tight. But react is really a good thing, it is about the fine-grained component concept, is actually the UI as a building blocks to play, before react out, I have the idea of developing a library, can let the UI and play the same name as the building block also named toy, but cough clearly proved that this is not easy.
Compared to angular, I think react as the official said is a viewcontrol rather than a simple view, compared to the current popular VMS maybe we call VC, plus state, throw away the data source, react constructs each component is one, We call it Scv,state-control-view, which controls the change of view through state, while the data source is only responsible for updating the state, avoiding the flow of data between view and modal. React treats each component as a subclass of the component class, and can maintain a variety of changes through a simple combination, essentially, the scope of state and angular is not different, it is a condition-managed object, But react distinguishes between props and state, and scope is clearly a mixture of not only props but also state and sometimes even modal. This leads to a fundamental flaw in the command system, which is that as development progresses, more and more can not be separated, angular another big problem is to rely on injection, the IOC itself should be a good thing, this is angular out of a great feature, However, because the JavaScript itself lacks the module function, this kind of dependency injection becomes the problem, for a large-scale application, because of the progress of the problem, the development is often generated a large JS file group, and instructions, controllers, service interdependence led to the project can be opened to a poor, In order to reuse a command, it was discovered that a whole bunch of services and controllers would be introduced, and, of course, the instructions were obviously the angular bootstrap started. Angular deprives the command of rendering rights and also leads to the use of instructions far less flexible than the react component. So angular is more suitable for the development of a certain standard applications, such as management systems, various management systems, backstage, front desk and so on. Finally be criticized by the nature is angular two-way binding, this thing is a double-edged sword, now, for react is only a province of SetState, is also a component of the update right, In the react you change the value of its properties through This.state does not start the UI re-rendering, only call SetState method, and angular scope of the move change, the comparison, react release the right to update the component, and angular is to automate it, it seems The former's approach is clearly more beneficial.
Thoughts on react and angular