Find out how to use REST requests in your Angular 2 application to get data from a CouchDB server and how to correctly process your data for output.
- [Narrator] Let's replace the use of URL fragments…in our user-list component with an http request…to our remote server.…While technically, our server is hosted locally,…its bound to a different port from our @angular app.…Which means @angular can communicate with our database…as if it was actually hosted remotely.…We start by importing the http module class…from @angular http into our app module, adding it to…our list of imports in the decorator.…We do this by creating a new import statement…in our app dot module file,…referencing HttpModule…between the brackets imported from @angular slash http.…
Note that H and M in the class name are capitalized.…Down in the decorator, under the imports property,…we'll then import that HttpModule as part of the app.…This will give us access to all the Http requests…throughout our application.…We then import the Http class from @angular http…into our user-list component…instantiating it in the constructor.…At the top of our file, we'll create a new import statement…between the brackets. We'll import the Http class…
- 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.