Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Which is better, Angular or Vue?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "which is more suitable, Angular or Vue". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn which is more suitable, Angular or Vue.

Overview

Angular is a very popular enterprise solution. Banks, financial institutions and back-end developers usually support Angular. Angular is supported by Google and is used by many well-known companies around the world, such as WhatsApp,Instagram,PayPal.

Vue was founded by you Yuxi, a former Google employee (you Xiaoyou @ weibo). You Yuxi worked in Google's Angular group at the beginning, so he knows a lot about Angular. Vue absorbs the essence of Angular and provides the characteristics of rapid construction and easy to use. Because its creator is Chinese, it is more naturally in line with the thinking of Chinese people. Vue is very popular in China. For example, Ali, Baidu, Xiaomi, ele.me, Meituan, bilibili and so on are all used, and more than a dozen well-known projects such as GitLab,Grammarly,Chess,fontawesome are also using Vue.js.

Angular is the default business solution for developing enterprise application clients. Angular is a more powerful and mature framework that usually takes more time to develop applications. Vue is very suitable for simple, easy-to-use, high-performance applications and for rapid prototyping.

Comparison between the two

Development community

As a result of Google's endorsement, it is easy to enjoy the cool under the big tree, and Angular is more stable and mature with rapid development. Angular has 313000 followers on Twitter, while Vue has 128000 followers. YouXiaoyou has less than 8w followers on Weibo and Zhihu has about 9w. To compare the recent downloads of Angular and Vue, compare the number of downloads of NPM in the past year:

GitHub activity index

The number of GitHub active users of the two frameworks is very interesting. Vue has more stars and more Fork than Angular. So far, Vue has 18743 Fork and 131381 stars, while Angular has only 12144 Fork and 46265 stars. Vue is obviously more popular, probably because Chinese people use it more. Angular leads in the number of contributors: 869 to 268. Because Angular has a longer history, this is in line with expectations.

Developer survey

According to the Js 2018 survey, Vue.js is doing very well. The Vue position not only offers an average salary equal to that of Angular, but also far fewer people give up after initial use than Angular. At present, about the same number of experienced developers are willing to work with Vue and Angular at work, but there are not many pure Angular developers, and more people support Vue and React. The results of the survey show that more people are more interested in learning Vue.

Trend of the job market

At the same time, Angular still dominates the job market. Angular is declining in terms of job opportunities, has been overtaken by ReactJs, and Vue is rapidly following up. Recent articles on jobfluent clearly show this trend. In comparison, there are more jobs in Angular than in Vue. But it is estimated that Vue will catch up soon, especially in the domestic market (data are not available).

Performance comparison

Next, let's compare run-time performance. In general, in most metrics, Angular and Vue are green, or worse, yellow. There is only one indicator that does not perform well for Angular: the startup time of non-keyed scripts. 227.6 of Angular compared to 56.9 of Vue, it is clear that referencing Angular in the code base can cause performance problems. In applications where space and memory are limited, it is natural to choose Vue. Based on general data, startup and memory allocation are weaknesses of Angular, which is superior to Vue in run-time metrics. For detailed results and scripts, see github Warehouse (github:/krausest/js-framework-benchmark)

Grammatical contrast

Some of the functions of Vue.js are derived from Angular. Templates, model bindings, loops, conditions, and event bindings all work similarly. Since there are more Angular developers than Vue, it is easy to switch from Angular to Vue. So here are some examples of the similarities between the two:

Template

Technically, you can rely on the same syntax. Template engines are slightly different when evaluating objects, arrays, and json. The same syntax is:

{{expression}}

Model binding

The syntax and principle are very similar, except for the difference in attribute names.

Angular:

VUE:

Cycle

The Vue syntax is obviously inspired by Angular, and there is little difference between the two. Note: Vue.js 's v-repeat simplifies the ng-repeat syntax.

Angular:

VUE:

Conditional statement

The code is basically the same except that the ng- and v-prefixes are different.

Angular:

VUE:

Event binding

In Angular, there are different event names, such as ng-click,ng-mousedown,ng-mouseover, etc. In Vue, there is an event binding property: v-on. The event name is specified in the string that describes the binding.

Angular:

VUE:

There are other obvious similarities between Angular and Vue. But all these similarities are to be expected, after all, vue.js is largely borrowed from the essence of Angular.

Grammatical differences

Although there are so many similarities, the two grammars are obviously different. The Angular framework must use TypeScript. Vue does not enforce the use of TypeScript. Vue.js supports TypeScript's static type checking system, but its usage is not required. There is no general code writing method in Vue.js, which allows developers to choose a free coding style and way. The learning curve of Vue.js is far less steep than that of Angular. Vue developers can start writing code by hand within a day. So Vue can be used to quickly develop demo prototypes and iterate based on it to speed up the development process. Let's talk about the grammatical differences between the two in detail, including Angular, components and instructions (Vue).

The Angular module can contain any function fast, not necessarily a component.

On the other hand, vue.js components are componentized logic.

Angular instructions are usually more complex than vue.js instructions. Vue separates instructions and components more clearly. The Vue.js instruction only encapsulates the DOM operation, while the Angular instruction can satisfy more use cases. In Angular, a component is just a specific instruction.

At this point, I believe you have a deeper understanding of "which is more suitable, Angular or Vue". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report