Search code examples
angularrenderer

Can't Find Renderer2 in Angular 4


I may be missing something completely but I am trying to use Renderer2 in my project. From what I can see, it requires Angular4, which I have.

However, whenever I try to add it to my project, it comes up as "/node_modules/@angular/core/core"' has no exported member 'Renderer2'"

I've tried updating Angular to the latest, as well as deleting my node_modules folder and running npm install but I still get the same error.

Should I be using Renderer instead? Did I just miss some point of the documentation?

Here are some screenshots:

Version of AngularVisual Studio Code only showing Renderer


Solution

  • Try restarting your Visual Studio, this happens to me sometimes too