Skip to content

Full Stack Development Series Part 9: User Authentication and JWT Support in Angular #73

@uaKorona

Description

@uaKorona

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 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions