Exercise 29: Using Scope and Bindings - jkneal/spring-angular-train GitHub Wiki
Goals
Learn how to use $scope and create bindings
Instructions
- 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’
- In app.html, add the following elements to the div with class ‘container’:
h1element, within the body write the value for scope property ‘name’addresselement, within the body write the value for scope property ‘address’spanelement with class ‘label label-default’, within the body write the result of invoking the scope method ‘getStatus’
VERIFICATION
-
Start the training application and go to the app home page
-
Click on the link 'Angular Exercises', verify the page looks like the following: