Exercise 29: Using Scope and Bindings - jkneal/spring-angular-train GitHub Wiki

Goals

Learn how to use $scope and create bindings

Instructions

  1. In store-controller.js, add the following data to the scope for the controller ‘storeCrtl’ controller:
  • name - 'Joe's Sports Store'
  • address = '5100 51st Chicago, IL'
  • Now add a method to the scope named ‘getStatus’. The method should take no arguments and return the string ‘Open’
  1. In app.html, add the following elements to the div with class ‘container’:
  • h1 element, within the body write the value for scope property ‘name’
  • address element, within the body write the value for scope property ‘address’
  • span element with class ‘label label-default’, within the body write the result of invoking the scope method ‘getStatus’

VERIFICATION

  1. Start the training application and go to the app home page

  2. Click on the link 'Angular Exercises', verify the page looks like the following:

    images/ex29.jpg