The difference between Vue.js and angular.js

Image for post
Image for post

Description of Vue

HTML template + JSON data, and then create a Vue instance, it’s that simple

A description of Angular

AngularJS is designed to overcome the shortcomings of HTML in building applications. HTML is a good declarative language designed for static text display, but it seems weak to build WEB applications. So I did some work (you can think of it as a trick) to make the browser do what I want.

It can be seen that Vue is relatively simpler than Angular. Vue.js is much simpler than Angular in terms of API and design, so you can quickly grasp all its features and invest in development.

The main differences are

1. Vue is just the view layer in mvvm, just a tool library like jquery, not a framework, and angular is a mvvm framework.

2. Vue’s two-way bonding is implemented based on the getter/setters in ES5, while Angular implements a set of template compilation rules by itself, which requires the so-called “dirty” check, but Vue does not. Therefore, Vue is more efficient in performance, but the price is that it cannot support browsers below ie9.

3. Vue needs to provide an el object for instantiation, and all subsequent scopes are also under the el object, while angular is the entire html page. A page can have multiple Vue instances, but angular doesn’t seem to play that way.

4. Vue is really easy to use, and the cost of learning is relatively low, but the information that can be referred to is not very rich, the official documents are relatively simple, and there is a lack of comprehensive use cases. For advanced usage, you need to study the source code yourself, at least for now.

5. Angular uses two-way binding, Vue also supports two-way binding, but the default is one-way binding, and data is passed one-way from the parent component to the child component. Use one-way binding in large applications to make the data flow easy to understand.

6. In Vue.js, instructions and components are divided more clearly. Instructions only encapsulate DOM operations, while components represent a self-sufficient independent unit-with its own view and data logic. There are a lot of confusions between the two in Angular.

Written by

Digital Nomad

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store