升級到 AngularCli9 後 ngx/cache 不能運行問題

關鍵字

"Can't resolve all parameters for MemoryCacheService"
"Can't resolve all parameters for LocalStorageService"git

問題描述

升級到 AngularCli 9 以後 ngx-cache 模塊加入後,運行會出現上述問題github

解決方案

注入方式由typescript

{ provide: CACHE, useClass: (MemoryCacheService) }

改成ide

{ provide: CACHE, useClass: (MemoryCacheService), deps: [PLATFORM_ID] }

其實就是增長了 PLATFORM_ID 做爲參數code

詳情在 Angular 9 + Ivy #128ip

相關文章
相關標籤/搜索