Expressions

A great feature of angularjs is the capability to add expressions inside the HTML template. angularjs evaluates expressions and then dynamically adds the result to a web page. Because expressions are linked to the scope, you can have an expression that utilizes values in the scope, and as the model changes, so does the value of the expression.

Controllers

angularjs completes the MVC framework through the implementation of controllers. Controllers augment the scope by setting up the initial state or values in the scope and by adding behavior to the scope. For example, you can add a function that sums values in a scope to provide a total so that if the model data behind the scope changes, the total value always changes.

You add controllers to HTML elements by using a directive and then implement them as JavaScript code in the background.

Data Binding

One of the best features of angularjs is the built-in data binding. Data binding is the process of linking data from the model with what is displayed in a web page. angularjs provides a very clean interface to link the model data to elements in a web page.

In angularjs, data binding is a two-way process: When data is changed on a web page, the model is updated, and when data is changed in the model, the web page is automatically updated. This way, the model is always the only source for data represented to the user, and the view is a projection of the model.

Services

Services are the major workhorses in the angularjs environment. Services are singleton objects that provide functionality for a web app. For example, a common task of web applications is to perform AJAX requests to a web server. angularjs provides an HTTP service that houses all the functionality to access a web server.

The service functionality is completely independent of context or state, so it can be easily consumed from the components of an application. angularjs provides a lot of built-in service components for basic uses, such as HTTP requests, logging, parsing, and animation. You can also create your own services and reuse them throughout your code.

Dependency Injection

Dependency injection is a process in which a code component defines dependencies on other components. When the code is initialized, the dependent component is made available for access within the component. angularjs applications make heavy use of dependency injection.

A common use for dependency injection is consuming services. For example, if you are defining a module that requires access to the web server via HTTP requests, you can inject the HTTP service into the module, and the functionality is available in the module code. In addition, one angularjs module consumes the functionality of another via dependency.

Compiler

angularjs provides an HTML compiler that will discover directives in the angularjs template and use the JavaScript directive code to build out extended HTML elements. The angularjs compiler is loaded into the browser when the angularjs library is bootstrapped. When loaded, the compiler will search through the HTML DOM in the browser and link in any back-end JavaScript code to the HTML elements, and then the final application view will be rendered to the user.