Find out how to retrieve data from multiple servers for the same page of your Angular 2 application using REST requests.
- [Instructor] Let's update our app…to display location info for each user in our user list.…We start by opening our CouchDB admin console…and clicking on our user database.…From here, we'll click on the plus sign…and create a New Doc with an ID of locations.…This record will have a property…that contains an array of strings…that represent each user's location.…
You can call this property whatever you'd like.…I'll call mine regions.…If you're following along with the exercise files,…you can speed things up by copying the array of locations…found in the locations.json file…into the new database entry.…Once copied, remember to save your changes…by clicking the Create Document button…before closing the database admin panel.…Back in our user-list.component,…we'll make a new get request in the ngOnInit method…to retrieve the database records…storing our location's array.…
You can use HTTP or JSONP to make this request.…I'll use HTTP here by referencing this.http.get.…I'll pass in the URL for our database entry,…which is http://localhost:5984/user/locations.…
- Overview of data storage options
- Saving and retrieving data from the browser
- Setting routes in the URL
- Using query strings and fragments instead of routes
- Saving and retrieving data from a server
- Working with user input
- Using JSONP instead of HTTP
- Why writing custom services is important
- Writing custom services for working with browsers and servers
Skill Level Intermediate
1. Getting Started
Application overview1m 39s
2. Data Storage Options
3. Storing Data in the Browser
4. Storing Data on a Server
5. Writing Custom Services
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.