Summary

In this chapter, we discussed the AngularJS scope object. Scope is an execution context for expression. AngularJS scopes are organized in a data structure that mimics the DOM structure of the applying model. Scope is the glue between the application controller and view. We also covered AngularJS's scope inheritance. Each application in AngularJS has one root scope, but may have several child scopes. The AngularJS application can have multiple scopes because some AngularJS directives create their own child scope. In the AngularJS scope lifecycle section, we discussed how scope's lifecycle works. When the browser calls the JavaScript, it executes outside the AngularJS framework execution environment, which suggests that AngularJS is unaware of model modifications. We also talked about how to add behavior to the AngularJS scope object. In behaviors, the directive's parent scope is used by default; using the parent scope in the directive, we can add the behavior to the scope.

Later in this chapter, we discussed AngularJS's controller and controller inheritance. AngularJS controllers are fundamentally the entry points to the presentation layer. The controller contains all the functions that we need to call on a page. We can call AngularJS's controller in the DOM using the ng-controller directive. The AngularJS ng-controller directive creates a new child scope for each controller's scope. We can use the hierarchy of the scopes that inherit from each other. Each controller has access to its properties and functions, along with the controller's properties and functions higher up the hierarchy. At the end of this chapter, we talked about AngularJS's built-in filters and showed you how to create custom filters.

In the next chapter, we will talk about how to communicate with the server using AngularJS.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset