ngx-gallery: Renderer error with angular 9
After updating to angular V9, the Renderer class was removed, so there’s a few errors being thrown:
ERROR in node_modules/ngx-gallery/ngx-gallery-helper.service.d.ts:1:22 - error TS2724: Module '"C:/Users/Documents/repos/real-estate-client/node_modules/@angular/core/core"' has no exported member 'Renderer'. Did you mean 'Renderer2'?
1 import { ElementRef, Renderer } from '@angular/core';
~~~~~~~~
node_modules/@angular/core/core.d.ts:5680:31
5680 export declare abstract class Renderer2 {
~~~~~~~~~
'Renderer2' is declared here.
node_modules/ngx-gallery/ngx-gallery-preview.component.d.ts:1:89 - error TS2724: Module '"C:/Users/Documents/repos/real-estate-client/node_modules/@angular/core/core"' has no exported member 'Renderer'. Did you mean 'Renderer2'?
1 import { ChangeDetectorRef, EventEmitter, OnInit, OnChanges, SimpleChanges, ElementRef, Renderer } from '@angular/core';
~~~~~~~~
node_modules/@angular/core/core.d.ts:5680:31
5680 export declare abstract class Renderer2 {
~~~~~~~~~
'Renderer2' is declared here.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 36
- Comments: 35
https://github.com/kolkov/ngx-gallery try this full compatible Angular 8, 9 version please.
dear kolkov, thanks for sharing this , could you please suggest what is to be changed if we want to keep existing library only
I updated all references to the deprecated Renderer service to Renderer2 inside
ngx-gallery-helper.service.d.ts
andngx-gallery-preview.component.d.ts
but then I got the error:Uncaught Error: Can't resolve all parameters for NgxGalleryPreviewComponent: ([object Object], [object Object], [object Object], ?, [object Object]). at syntaxError (compiler.js:2281) at CompileMetadataResolver._getDependenciesMetadata (compiler.js:21063) at CompileMetadataResolver._getTypeMetadata (compiler.js:20958) at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (compiler.js:20573) at CompileMetadataResolver.loadDirectiveMetadata (compiler.js:20437) at compiler.js:26467 at Array.forEach (<anonymous>) at compiler.js:26466 at Array.forEach (<anonymous>) at JitCompiler._loadModules (compiler.js:26463)
https://stackoverflow.com/questions/60126992/cant-resolve-all-parameters-for-ngxgallerypreviewcomponent-after-ng-serve?noredirect=1#comment106345690_60126992
Hi, I have the same issue a few days ago. “Renderer error with angular 9” what to need to do uninstall ngx-gallery then install ngx-gallery-9 “https://www.npmjs.com/package/ngx-gallery-9” might be working.