From the course: Angular: Testing and Debugging
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Fixing dependency injection errors - Angular Tutorial
From the course: Angular: Testing and Debugging
Fixing dependency injection errors
- Dependency injection errors are usually related to un-exported modules or import statement typos. These issues can be difficult to catch because Angular emits errors to the browser console on execution and not on the import or export of a file. Angular's error messages can also be mysterious and usually traced back to an undefined variable in one of your files. Code editors like Visual Studio Code can be a big help here because they can reason about the relationships in your code base and forecast potential issues all without executing the code. Back in Visual Studio Code here, let's import our web storage service from the last video into our user list component. I'll go to the sidebar, click on source, app, user list, click on user list.component.ts to open the file, looks good. The first thing we need to do is create a new import statement, to import our web storage service. At the top of the file, I'll make a new line, type import and between the brackets I'll type a web storage…
Contents
-
-
-
-
-
(Locked)
Adding a local storage service4m 38s
-
(Locked)
Fixing dependency injection errors3m 38s
-
(Locked)
Getting and setting data in local storage3m 18s
-
(Locked)
Adding a custom Angular pipe4m 51s
-
Using regular expressions to find content4m 13s
-
(Locked)
Using a pipe to change HTML content4m 17s
-
(Locked)
Common pipe errors1m 53s
-
(Locked)
Understanding Angular decorators2m 6s
-
(Locked)
Challenge: Filter the array of users by locationId30s
-
(Locked)
Solution: Filter the array of users by locationId1m 23s
-
(Locked)
-
-
-
-
-