Skip to Content
Your First App

So far this is our typical workflow when making an AngularJS app:

  1. Create a module, and use ng-app in the view to define the application scope.
  2. Create a controller, and use ng-controller in the view to define the controller scope.
  3. Add data to $scope in the controller so they can be displayed with expressions in the view.



Let’s add more data to the controller and display them in the view. In the controller, attach another property to $scope named product. Set it equal to an object with the following properties:

{ name: 'The Book of Trees', price: 19 }

Then, in index.html inside <p class="title">, access the product’s name with and display it using an expression.


In <p class="price">, access and display the product’s price.

Folder Icon

Take this course for free

Already have an account?