full-stack-todo
full-stack-todo copied to clipboard
Full Stack Development Series Part 9: User Authentication and JWT Support in Angular
Hello ) I couldn't sign up on https://thefullstack.engineer/ so have decided to post my comment here:
In Storybook 7.0 + the code from Part 9 become failed with next error:
R3InjectorError(Standalone[StorybookWrapperComponent])[UserService -> UserService -> HttpClient -> HttpClient]:
NullInjectorError: No provider for HttpClient!
The reason is there is no root ngModule anymore. Previously you were able to add ModuleWithProviders, likely the result of a 'Module.forRoot()'-style call, to your 'imports' array of the moduleMetadata definition. This is now discouraged. Instead, you should use the applicationConfig decorator to add your application-wide providers. These providers will be passed to the bootstrapApplication function.
More details https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#angular-application-providers-and-modulewithproviders
I have added to my feature-register.component.stories
applicationConfig({
providers: [importProvidersFrom(HttpClientTestingModule)],
}),
``` and story has started running correctly