Find out how to add REST requests to your Angular 2 application to get and set data in a CouchDB database.
- Let's add methods to our web storage service,…that allow users to save the current filter state…to our couch DB database.…We start by creating a new import statement at the top…of our web storage service file, and importing the http…class from the angular/http module.…We'll also need to import the http module class into our…app module file, which gives our entire application…access to the necessary rest services we need…to communicate with our server.…
We do this by opening the app module file,…and creating a new import statement, importing…the http module class from angular/http.…We'll also need to add the http module class to our list…of imports in the NG module decorator.…Back on our web storage service file, we'll instantiate…the http class, in a constructor function, by typing…a new line, followed by constructor, and between the…parentheses, we'll type private http, and set it…to the http class type.…
We'll then create a new method called getRemote,…which will use the http instance to get the filter state…
Author
Released
2/22/2017- Analyzing Angular 2 error messages
- Identifying the causes of common error messages
- Preventing common errors with custom error handling
- Analyzing testing reports
- Reviewing common testing report errors and their likely causes
Skill Level Intermediate
Duration
Views
Related Courses
-
Angular 2 Essential Training
with Justin Schwartzenberger2h 48m Intermediate -
Angular 2: Widget-Based Architectures
with Derek Peruo52m 18s Intermediate
-
Introduction
-
Welcome57s
-
What you should know1m 3s
-
Exercise files48s
-
-
1. Getting Started
-
Application overview1m 49s
-
-
2. How Angular 2 Reports Errors
-
Error handling in Angular1m 21s
-
-
3. Common Angular 2 Errors
-
Adding a web storage service3m 38s
-
Fixing decorator errors2m 54s
-
Installing CouchDB1m 12s
-
Updating database documents1m 55s
-
Custom error handling5m 17s
-
-
4. Testing Angular 2 Applications
-
Testing Angular 2: Overview2m 43s
-
Fixing migration errors4m 30s
-
Testing components6m 25s
-
-
Conclusion
-
Next steps52s
-
- 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.
CancelTake 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.
Share this video
Embed this video
Video: Adding server storage methods