Replies: 1 comment
-
Since import { applicationConfig, Meta, moduleMetadata, Story } from '@storybook/angular'
import { provideRouter, withHashLocation } from '@angular/router'
export default {
decorators: [
applicationConfig({
providers: [
// The router is most likely going to interfere with your Storybook application/iframe
// route, but hash routes should be fine, so I also add `withHashLocation`.
provideRouter([ ...routes ], withHashLocation()),
],
})
],
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Hi,
I want to create my storybook file for my component which use routerLink.
I tested many solutions for mandatory imports:
// it works but is using RouterTestingModule which is deprecated
moduleMetadata({ imports: [ IconModule, RouterTestingModule ], })
// following the documentation, we should use the provideRouter([]) function but it doesn't work
moduleMetadata({ imports: [ IconModule, ], providers: [provideRouter([])] })
the obtained syntax error :
"Argument type {imports: IconModule[], providers: EnvironmentProviders[]} is not assignable to parameter type Partial "
Can you explain me, what's is wrong on this implementation?
Thanks
Additional information
Angular V18.0.5
Storybook V8.1.11
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions