Skip to content

Instantly share code, notes, and snippets.

@jnewman12
Created February 14, 2017 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnewman12/e30c930816cd2820c57944633915af86 to your computer and use it in GitHub Desktop.
Save jnewman12/e30c930816cd2820c57944633915af86 to your computer and use it in GitHub Desktop.
Angular Services Lab

Postal Service

postal service


Goals and Objectives

  • Practice sharing data between controllers
  • Inject services and dependencies into your controllers
  • Stretch Goal: change from controller as syntax to $scope

  1. Inject the PostalService service into the MailBoxes controller and render all the letters' subjects to the page.
  2. Create a new controller called NewMailController and inject the PostalService service into it
  3. Create a new method in PostalService that adds a letter to the letters array.
  4. Add NewMailController to index.html and wire it up so that when a user enters a new letter it's added to the PostalService?
  5. Create a ShowLetterController and inject the PostalService controller into it?
  • ShowLetterController should be in charge of showing a single letter and marking it read or unread
  1. Add delete functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment