O'Reilly logo

Learning AngularJS by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Interacting with the Scope in Expressions

Now that you have seen some basic AngularJS expressions, let’s take a look at how to interact with the scope inside AngularJS expressions. In the previous example all the input for the expressions came from explicit strings or numbers. This example illustrates the true power of AngularJS expressions that come from interacting with the model.

The code in Listing 5.3 implements a basic AngularJS application with a controller. The controller contains the variables speed, vehicle, newSpeed, and newVehicle in the scope. It also includes three functions, upper, lower, and setValues. These variables and functions are utilized in AngularJS expressions in the template shown in Listing 5.4.

The code in Listing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required