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

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.

主站蜘蛛池模板: 平邑县| 清流县| 东源县| 武冈市| 临湘市| 大姚县| 横峰县| 玛纳斯县| 青龙| 临汾市| 浦北县| 堆龙德庆县| 九台市| 松原市| 正镶白旗| 策勒县| 饶平县| 莱州市| 新乐市| 江永县| 巨鹿县| 巴南区| 新民市| 甘洛县| 镇赉县| 莱阳市| 讷河市| 茂名市| 车致| 应城市| 桃园县| 德清县| 理塘县| 同心县| 准格尔旗| 攀枝花市| 保亭| 斗六市| 宁蒗| 延边| 河西区|