Summary

A scope is the definitive source for data in AngularJS applications. A scope has direct relationships with the template views, controllers, modules, and services and acts as the glue that binds the application together. A scope also acts as a representation of a database or another server-side data source.

The scope life cycle is linked to the browser event loop so that changes in the browser can change the scope, and changes in the scope are reflected in the DOM elements that are bound to the scope. You can also add custom watch functions that are notified when the scope changes.

Scopes are organized into hierarchies, and the root scope is defined at that application level. Each instance of a controller also gets an instance of a child ...

Get Learning AngularJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.