0

I'm trying to import Renderer2 using:

import { Renderer2 } from '@angular/core';

However, I get the error

"Module '"project/node_modules/@angular/core/index"' has no exported member 'Renderer2'.

I'm unsure why this is happening. I'm using PrimeNG (here) which contains a component called ConfirmDialog which contains the same import statement, yet I don't run into any issues with it. I've seen posts that suggest Renderer2 is only compatible with Angular 4 - I'm currently using @angular/core 2.2.4. If Angular 4 is required, then shouldn't the ConfirmDialog of PrimeNG break (it doesn't)?

1 Answer 1

1

As you said that Renderer2 is only used in angular angular/core 4.x.x Project .If you upgraded the primeNG latest version "Sure Will not run according to the upgrading due to angular 4 version". So you need either Upgrade the project if you urgently need Renderer2. Instead you can use angular2 Renderer

Sign up to request clarification or add additional context in comments.

1 Comment

Completely forgot to check the version of PrimeNG I was actually using. I'm actually using 2.0.6 which uses the component Renderer. I was basing my question off of PrimeNG's latest github repo which is currently implemented for Angular 4, hence the use of Renderer2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.