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

Fixing dependency injection errors - Angular Tutorial

From the course: Angular: Testing and Debugging

Start my 1-month free trial

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