{"action":"created","issue":{"url":"https://api.github.com/repos/PillowPillow/ng2-webstorage/issues/100","repository_url":"https://api.github.com/repos/PillowPillow/ng2-webstorage","labels_url":"https://api.github.com/repos/PillowPillow/ng2-webstorage/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/PillowPillow/ng2-webstorage/issues/100/comments","events_url":"https://api.github.com/repos/PillowPillow/ng2-webstorage/issues/100/events","html_url":"https://github.com/PillowPillow/ng2-webstorage/issues/100","id":385789602,"node_id":"MDU6SXNzdWUzODU3ODk2MDI=","number":100,"title":"Can't resolve all parameters for LocalStorageService: (?).","user":{"login":"MasterRennor","id":12250247,"node_id":"MDQ6VXNlcjEyMjUwMjQ3","avatar_url":"https://avatars3.githubusercontent.com/u/12250247?v=4","gravatar_id":"","url":"https://api.github.com/users/MasterRennor","html_url":"https://github.com/MasterRennor","followers_url":"https://api.github.com/users/MasterRennor/followers","following_url":"https://api.github.com/users/MasterRennor/following{/other_user}","gists_url":"https://api.github.com/users/MasterRennor/gists{/gist_id}","starred_url":"https://api.github.com/users/MasterRennor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MasterRennor/subscriptions","organizations_url":"https://api.github.com/users/MasterRennor/orgs","repos_url":"https://api.github.com/users/MasterRennor/repos","events_url":"https://api.github.com/users/MasterRennor/events{/privacy}","received_events_url":"https://api.github.com/users/MasterRennor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-29T15:27:55Z","updated_at":"2018-11-30T10:59:05Z","closed_at":null,"author_association":"NONE","body":"@PillowPillow, apologies, if this has been solved in another ticket - I looked through them but couldn't find an answer.\r\n\r\n**Versions (please complete the following information):**\r\n - NgxWebstorage: [e.g. 3.0.0-beta.14]\r\n - Angular: [e.g. 7.1.1]\r\n\r\n**Describe the bug**\r\nI cannot create tests for components which import my project's StorageService (which internally imports LocalStorageService and SessionStorageService). Angular dependency injection needs them to be imported into the spec file or else it throws a 'missing providers' error. However, I end up with the following error when I do import them:\r\n\r\n```\r\nFailed: Can't resolve all parameters for LocalStorageService: (?).\r\n        error properties: Object({ ngSyntaxError: true })\r\n        Error: Can't resolve all parameters for LocalStorageService: (?).\r\n            at syntaxError (dist/vendor/@angular/compiler/bundles/compiler.umd.js:2497:21)\r\n            at CompileMetadataResolver._getDependenciesMetadata (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18746:39)\r\n            at CompileMetadataResolver._getTypeMetadata (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18639:30)\r\n            at CompileMetadataResolver._getInjectableTypeMetadata (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18861:25)\r\n            at CompileMetadataResolver.getProviderMetadata (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18870:26)\r\n            at eval (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18808:53)\r\n            at <Jasmine>\r\n            at CompileMetadataResolver._getProvidersMetadata (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18768:23)\r\n            at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18245:34)\r\n            at CompileMetadataResolver._getEntryComponentMetadata (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18842:32)\r\n            at eval (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18833:35)\r\n            at <Jasmine>\r\n            at CompileMetadataResolver._getEntryComponentsFromProvider (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18832:34)\r\n            at eval (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18805:96)\r\n            at <Jasmine>\r\n            at CompileMetadataResolver._getProvidersMetadata (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18768:23)\r\n            at eval (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18770:27)\r\n            at <Jasmine>\r\n            at CompileMetadataResolver._getProvidersMetadata (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18768:23)\r\n            at eval (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18391:76)\r\n            at <Jasmine>\r\n            at CompileMetadataResolver.getNgModuleMetadata (dist/vendor/@angular/compiler/bundles/compiler.umd.js:18382:53)\r\n            at JitCompiler._loadModules (dist/vendor/@angular/compiler/bundles/compiler.umd.js:25771:55)\r\n            at JitCompiler._compileModuleAndAllComponents (dist/vendor/@angular/compiler/bundles/compiler.umd.js:25759:40)\r\n            at JitCompiler.compileModuleAndAllComponentsAsync (dist/vendor/@angular/compiler/bundles/compiler.umd.js:25718:41)\r\n            at CompilerImpl.compileModuleAndAllComponentsAsync (dist/vendor/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js:212:35)\r\n            at TestingCompilerImpl.compileModuleAndAllComponentsAsync (dist/vendor/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js:148:35)\r\n            at TestBedViewEngine.compileComponents (dist/vendor/@angular/core/bundles/core-testing.umd.js:1724:35)\r\n            at Function.TestBedViewEngine.compileComponents (dist/vendor/@angular/core/bundles/core-testing.umd.js:1583:81)\r\n            at UserContext.testing_1.async (dist/@xtip/components/betslip/betslip.spec.js:195:27)\r\n            at ZoneDelegate.invoke (dist/vendor/zone.js/dist/zone.js:388:26)\r\n            at AsyncTestZoneSpec.onInvoke (dist/vendor/zone.js/dist/async-test.js:106:39)\r\n            at ProxyZoneSpec.onInvoke (dist/vendor/zone.js/dist/proxy.js:125:39)\r\n            at ZoneDelegate.invoke (dist/vendor/zone.js/dist/zone.js:387:32)\r\n            at Zone.runGuarded (dist/vendor/zone.js/dist/zone.js:151:47)\r\n            at runInTestZone (dist/vendor/zone.js/dist/async-test.js:234:29)\r\n            at UserContext.<anonymous> (dist/vendor/zone.js/dist/async-test.js:168:17)\r\n            at ZoneDelegate.invoke (dist/vendor/zone.js/dist/zone.js:388:26)\r\n            at ProxyZoneSpec.onInvoke (dist/vendor/zone.js/dist/proxy.js:128:39)\r\n            at ZoneDelegate.invoke (dist/vendor/zone.js/dist/zone.js:387:32)\r\n            at Zone.run (dist/vendor/zone.js/dist/zone.js:138:43)\r\n            at runInTestZone (dist/vendor/zone.js/dist/jasmine-patch.js:142:34)\r\n            at UserContext.<anonymous> (dist/vendor/zone.js/dist/jasmine-patch.js:158:20)\r\n            at <Jasmine>\r\n            at ZoneDelegate.invokeTask (dist/vendor/zone.js/dist/zone.js:421:31)\r\n            at Zone.runTask (dist/vendor/zone.js/dist/zone.js:188:47)\r\n            at drainMicroTaskQueue (dist/vendor/zone.js/dist/zone.js:595:35)\r\n\r\n```\r\n\r\n\r\nExample code:\r\n```\r\nimport { LocalStorageService, SessionStorageService} from 'ngx-webstorage';\r\nimport { StorageService } from '@app/common/services';\r\n\r\n...\r\n\r\nTestBed.configureTestingModule({\r\n      imports: [...],\r\n      declarations: [...],\r\n      providers: [\r\n        LocalStorageService,\r\n        SessionStorageService,\r\n        StorageService,\r\n      ]\r\n    });\r\n```\r\nThis looks like quite a common use case to me, and maybe I'm missing something. Any help would be appreciated."},"comment":{"url":"https://api.github.com/repos/PillowPillow/ng2-webstorage/issues/comments/443168741","html_url":"https://github.com/PillowPillow/ng2-webstorage/issues/100#issuecomment-443168741","issue_url":"https://api.github.com/repos/PillowPillow/ng2-webstorage/issues/100","id":443168741,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzE2ODc0MQ==","user":{"login":"MasterRennor","id":12250247,"node_id":"MDQ6VXNlcjEyMjUwMjQ3","avatar_url":"https://avatars3.githubusercontent.com/u/12250247?v=4","gravatar_id":"","url":"https://api.github.com/users/MasterRennor","html_url":"https://github.com/MasterRennor","followers_url":"https://api.github.com/users/MasterRennor/followers","following_url":"https://api.github.com/users/MasterRennor/following{/other_user}","gists_url":"https://api.github.com/users/MasterRennor/gists{/gist_id}","starred_url":"https://api.github.com/users/MasterRennor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MasterRennor/subscriptions","organizations_url":"https://api.github.com/users/MasterRennor/orgs","repos_url":"https://api.github.com/users/MasterRennor/repos","events_url":"https://api.github.com/users/MasterRennor/events{/privacy}","received_events_url":"https://api.github.com/users/MasterRennor/received_events","type":"User","site_admin":false},"created_at":"2018-11-30T10:59:05Z","updated_at":"2018-11-30T10:59:05Z","author_association":"NONE","body":"@PillowPillow, thanks for you help! I'll try out your suggestions soon (and the second is sure to work) - but you can go ahead and close the issue."}}
{"actor":{"display_login":"MasterRennor"}}