官术网_书友最值得收藏!

Zones

Zones are one of the new concepts that have been introduced in Angular. The concept of Zones was migrated from Dart to JavaScript.

The main reason why a lot of developers were attracted towards Angular initially was by its Auto-magic Data Binding among other things. This was achieved using scopes in Angular 1.x. In Angular 2, we are using Zone.js (https://github.com/angular/zone.js) to achieve the same.

Whenever there is a change in the data, Angular updates the appropriate stakeholders (variables, interfaces, providers, and so on) with new data. Angular can track all synchronous activities quite easily. But for change detection in asynchronous code, such as event handling, AJAX calls, or Timers, Angular 2 uses Zone.js.

To know more about zones, how they work, and change detection in Angular, check out Zones in Angular: http://blog.thoughtram.io/angular/2016/02/01/zones-in-angular-2.html and Angular change detection explained: http://blog.thoughtram.io/angular/2016/02/22/angular-2-change-detection-explained.html.

主站蜘蛛池模板: 麟游县| 松溪县| 织金县| 民勤县| 曲阜市| 巴马| 遂平县| 尼木县| 洪湖市| 高雄县| 平潭县| 肇庆市| 兴化市| 温宿县| 宜兰县| 瓦房店市| 从江县| 太谷县| 康定县| 沙雅县| 富顺县| 清徐县| 武城县| 博湖县| 蛟河市| 襄城县| 孟州市| 会同县| 黎城县| 波密县| 东台市| 海门市| 西华县| 车险| 石林| 赣州市| 新河县| 泾源县| 习水县| 黔西县| 滨州市|