What are the main differences between AngularJS an

2020-05-27 03:48发布

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).

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

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.

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.

2条回答
聊天终结者
2楼-- · 2020-05-27 04:36

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).

查看更多
▲ chillily
3楼-- · 2020-05-27 04:44

I think the main difference between Angular and React is the fact that Angular is using 2 way data binding, while React is using one way. Maybe this article will make the things clearer for you: https://www.airpair.com/angularjs/posts/angular-vs-react-the-tie-breaker
p.s. I really don't understand why this question is downvoted...

查看更多
登录 后发表回答