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

What is the core concept of Angular2?

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces "what is the core concept of Angular2". In daily operation, I believe many people have doubts about what the core concept of Angular2 is. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubt of "what is the core concept of Angular2?" Next, please follow the editor to study!

The first point: Angular2 deleted the concept of $scope.

In ng1.x, $scope is a very powerful and scary thing, leaving developers to make their own $apply if they don't agree. Ng2 responded to the strong complaints from the community by removing (or hiding) the $scope, so developers no longer need to be aware of it. In addition, because ng2 introduces zone.js, it is no longer necessary to manually modify the data model in various callback functions.

This shows that the power of the masses to complain is still quite powerful!

The second point: the ng-controller instruction has been deleted.

Controller is finally integrated with Component. What the little monk wants to say is that Backbone has already done this. At first, you only focus on digging your own holes and do not look at the tactics of friendly forces. Fortunately, it is not too late for the prodigal son to return.

The third point: the dirty value detection mechanism has been greatly evolved.

As we all know, "two-way data binding" works because there is such a magical thing as "dirty value detection" at the bottom. In fact, the dirty value detection mechanism in ng1.x is very inefficient, which is why people keep complaining that the bound objects can not be too many and too deep.

Then, in ng2, this mechanism has greatly evolved, introducing not only one-way binding, but also a variety of binding strategies, such as: only one detection, using JIT to dynamically generate dirty value detection code and so on. There is no doubt that with these tools, data binding efficiency is no longer an issue.

The fourth point: the problem of nested routing.

As we all know, there is a very annoying problem in ng1.x. Official routing mechanisms cannot be nested, which results in people having to rely on third-party ui- route libraries in the development process. There is no such problem in ng2, because ng2 routing is based on Component and naturally supports nesting.

The fifth point: the transformation of dependency injection mechanism.

The dependency injection in ng2 is almost the same as the annotations in Java, and it is estimated that the core development team is mixed with the god of Java. If you are familiar with the use of Spring annotations, there is little learning cost to write components for ng2.

Sixth point: the framework as a whole is based on TypeScript development.

This is a change of *, but don't be afraid, because as long as you remember my words, you will no longer worry: TypeScript, like ActionScript3, is just a perverted version of Java.

At this point, the study of "what is the core concept of Angular2" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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