mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-17 05:02:23 +08:00
Fix Angular bug where forRoot() is called twice
This commit is contained in:
parent
8c8974884f
commit
80a3cba00d
@ -128,11 +128,14 @@ export abstract class AbstractRenderer {
|
||||
// Providers for BrowserAnimations & NoopAnimationsModule
|
||||
analyzedMetadata.singletons,
|
||||
importProvidersFrom(
|
||||
...analyzedMetadata.imports.filter((imported) => {
|
||||
const { isStandalone } = PropertyExtractor.analyzeDecorators(imported);
|
||||
return !isStandalone;
|
||||
})
|
||||
...analyzedMetadata.imports
|
||||
.filter((imported) => {
|
||||
const { isStandalone } = PropertyExtractor.analyzeDecorators(imported);
|
||||
return !isStandalone;
|
||||
})
|
||||
.map((imported) => imported.ngModule || imported)
|
||||
),
|
||||
...analyzedMetadata.imports.flatMap((imported) => imported.providers).filter(Boolean),
|
||||
analyzedMetadata.providers,
|
||||
storyPropsProvider(newStoryProps$),
|
||||
].filter(Boolean);
|
||||
|
@ -65,6 +65,7 @@ export const createStorybookWrapperComponent = (
|
||||
declarations,
|
||||
imports,
|
||||
exports: [...declarations, ...imports],
|
||||
providers,
|
||||
})
|
||||
class StorybookComponentModule {}
|
||||
|
||||
@ -77,7 +78,6 @@ export const createStorybookWrapperComponent = (
|
||||
template,
|
||||
standalone: true,
|
||||
imports: [ngModule],
|
||||
providers,
|
||||
styles,
|
||||
schemas: moduleMetadata.schemas,
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user