Find out how to fix common errors in your Angular 2 application caused by decorator issues.
- Let's add our new web storage service to the…decorator in our user list component.…We'll need to add our web storage service to the array of…providers before we can use the service in our component.…We do this by going into the component decorator,…and adding the XyzWebStorageService to the end of our…provider's array.…We'll also need to instantiate our service in the…constructor.…We do this by creating a new line and typing Private…XyzWebStorageService and setting it to the type of our…XyzWebStorageService class.…
Forgetting to add your service to the array of providers is…a common error, which we can mimic here by deleting the…reference to our Web Storage Service class in the provider's…array.…If you try to run your code without the service declared as…a provider, Angular will throw an error telling you there is…an uncaught error and that no provider for your service was…found.…To fix the error, just add your service class to the list of…providers in the decorator.…We can confirm our changes back in the browser.…
- 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
Q: This course was updated on 10/30/2018. What changed?
A: The following topics were updated: common Angular 2 errors—including dependency injection errors—and testing Angular 2 apps.
Angular Essential Trainingwith Justin Schwartzenberger2h 48m Intermediate
Angular 2: Widget-Based Architectureswith Derek Peruo52m 18s Intermediate
1. Getting Started
Application overview1m 49s
2. How Angular 2 Reports Errors
Error handling in Angular1m 21s
3. Common Angular 2 Errors
4. Testing Angular 2 Applications
- 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.