前端 - angular和react各自有什么优缺点
天蓬老师
天蓬老师 2017-05-15 17:02:17
0
5
726

angularreact各自有什么优缺点?怎么对两者进行取舍?
目前是有个大的项目要重构,因为之前没有使用过市面上的各种MV*框架,所有现在在考虑是否要使用react来管理view,但是毕竟只是view,所以在想是不是不直接上angular

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(5)
某草草

Actually, I suddenly felt that You Xiaoyou’s introduction on the vue official website is very good, why not take a look:



我想大声告诉你

Talk about shortcomings,

Angular, with a lot of Java flavor, the framework is large, has many concepts, and has complex syntax. TypeScript is also introduced later. Upgrading from 1 to 2 almost becomes a new framework. It feels too bloated. The front-end problem is very simple. Why? It’s so complicated.

React, a lot of Facebook flavor, JSX, Webpack, Babel. The concept is to make more and more appointments as you go to the back. And recently, I feel that the community is too radical, as if the ecology has not been completed yet, it has attracted a lot of people to rush in. , gradually bringing all kinds of private goods inside.

Vue, after all, Xiaoyou alone can’t defeat a big company...

黄舟

Look here for Angular: https://ruby-china.org/topics/27590#reply7

React is not a framework, there is no comparison. Just use React for small and medium-sized projects with a few pages. If you don’t have the architectural capabilities for large-scale projects, just use Angular. In fact, Angular is lagging behind (or mature) in many aspects. I have almost said this in the link above. However, ordinary developers do not need to consider these (after you realize this, you will not be ordinary). , you will naturally make your own judgment at that time).

伊谢尔伦

Some people actually say that React is not a framework and is forced to be lightweight. When you use it, don’t you use the full set of react-route+redux+react together

angular1 To be honest, there are no shortcomings. In a five-year framework, all the pitfalls that need to be overcome have been overcome. If I want to do two-way binding, except for avalon, which uses VBS to play tricks, only dirty check is compatible with IE8
As for the architecture, It’s not his fault that the design is complex. Angular itself is a large and comprehensive framework. The only thing missing is state management

Then react, the same thing, coupled with redux, realizes state management, which is the direction of future big applications. By the way, angular2 can also use redux

Furthermore, I don’t think ecma6 has the advantage of syntax, just syntax sugar, there is no essential change (the real qualitative change is that ie9+ supports getters/setters)
A language as complex as Java is just used to writing js
There are really people Do you think it’s good to mix js and html like react itself (not counting webpack)? It’s so anti-human

Ty80

AboutAngularReact,其区别其实非常之大。
Angular是一个MVC框架,因为其涵盖MVC全部的内容,所以它几乎能代替大部分后端的工作,特别是其双向数据绑定等功能,可以说使用相当方便(但学习成本也高)。但缺陷就是Angular过重,前端大部分情况下并非需要一个完整的MVC框架,因为大部分逻辑应该交给后端来完成。这也导致了Angular永远无法登上台面,一个正常的网站不会容忍一个为了功能全面而大幅消耗性能的框架。所以Angular大部分时候只能藏于身后,在一些后台管理页面中使用。
React则不同,其最大的优势就是其轻量级,Facebook看到了前端使用MVC框架的劣势,而前端大部分时候只有View的操作,所以React只着重于View层的开发。特别是其Virtual DOM的思维,大幅提升前端页面渲染的速度。由于其轻量级,所以得以在大流量网站上使用,例如React研发所针对的Instagram上已经使用,还有阿里版变种的Weex is also used on Taobao and other websites.

The biggest difference between the two is the difference between light and heavy. The suggestion is to use React,小访问量重逻辑的页面用Angular for pages with large traffic and light logic.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template