AngularJS和ReactJS之间的主要区别是什么? [英] What are the main differences between AngularJS and ReactJS

查看:134
本文介绍了AngularJS和ReactJS之间的主要区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个将转换为移动应用程序的网站(我想要构建的内容更适合作为网站而不是应用程序,因此建筑本身应该作为网站)。

I need to create a web site which will be converted to a mobile application (What I want to build is more suited to be a web site than an application so the building itself should be as a website).

由于我对桌面和Android原生开发世界比较熟悉,因此我对Web客户端开发知之甚少。在阅读了一点后,我决定在客户端使用这些技术:HTML5,CSS3,Bootstrap,React.js

Since I'm more familiar with the desktop and Android native dev world, I got very little knowledge of web client side development. After reading a little I've decided to use these technologies for the client side: HTML5, CSS3, Bootstrap, React.js

问题是我读过那个Angular实际上是一个完整的MVC框架,而React有一些更具体的角色,就像比较汽车(Angular)和引擎(React)。我已经看到有关如何使用hello world和事件处理等技术进行某些操作的比较以及类似的东西,所以我不需要知道如何在一些比较网站中显示的具体内容。

The problem is that I've read that Angular is actually a full MVC framework while React has some more specific roles and it's like comparing a car (Angular) to an engine (React). I have already seen comparisons regarding how to do some actions with both technologies like hello world and event handling and stuff like that so I don't need to know how to specific things like what they show in some comparison websites.

所以我的问题是我与Angular相比,与React相比可以达到的区别是什么?如果我使用React,会不会有我无法做到的事情?我什么时候应该使用另一个?如果我使用React,我仍然可以构建一个完全可操作的客户端吗?

So my question is what is the difference between what I can accomplish with Angular compared to React? If I use React, are there going to be things I wouldn't be able to do? When should I use one over the other? If I use React, will I still be able to build a fully operational client side?

我想强调一点,我不想要个人意见。我只想了解有关客户开发的事实,并了解我能做什么和不能用它们做什么。

I would like to emphasize I don't want a personal opinion. I just want the facts regarding client development and to know what I can and can't do with them.

推荐答案

AngularJS是一个像你所说的完整框架,它旨在使用MVC设计编写单页面应用程序(SPA)。
另一方面,ReactJS被认为仅用于开发View,或者换句话说,用于UI组件。
在我看来,Angular相当复杂,而React是一个相对较小的库,但React的虚拟DOM速度更快(除非需要,否则不会直接操作DOM)。
此外,反应可以与其他库一起用于路由,而angular已经拥有它。
我认为你可以使用两种技术构建相同的网站,即使React用于UI,它仍然可以有逻辑,大网站是用它构建的(例如Instagram和Facebook)。

AngularJS is a full framework like you said, which is designed to write single page applications (SPA) using the MVC design. On the other hand, ReactJS is consider to be for the development of the View only, or in other words, UI components. In my opinion Angular is rather complex to learn while React is relatively a small library, but React is faster for its virtual DOM (It doesn't manipulate the DOM directly unless needed). Also react can be used with other libraries for things like routing while angular already have it. I think you can build the same website using both techologies, even though React is for UI, it still can have logic and big websites are built with it (Instagram and Facebook for example).

这篇关于AngularJS和ReactJS之间的主要区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆