From e483723de57bbc9fea4b63a8d3f8d3559a678486 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 17 Feb 2023 09:51:45 +0100 Subject: [PATCH] Add some stories for angular --- .../client/angular-beta/AbstractRenderer.ts | 2 +- .../provided-in.stories.ts | 24 ------------- .../app-initializer-use-factory.stories.ts | 34 +++++++++++++++++++ 3 files changed, 35 insertions(+), 25 deletions(-) delete mode 100644 code/frameworks/angular/template/stories/basics/component-with-provided-in/provided-in.stories.ts create mode 100644 code/frameworks/angular/template/stories/others/app-initializer-use-factory/app-initializer-use-factory.stories.ts diff --git a/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts b/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts index 477aedc7505..5088bba3313 100644 --- a/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts +++ b/code/frameworks/angular/src/client/angular-beta/AbstractRenderer.ts @@ -130,10 +130,10 @@ export abstract class AbstractRenderer { const providers = [ // Providers for BrowserAnimations & NoopAnimationsModule analyzedMetadata.singletons, - analyzedMetadata.providers, importProvidersFrom( ...analyzedMetadata.imports.filter((imported) => !isStandalone(imported)) ), + analyzedMetadata.providers, storyPropsProvider(newStoryProps$), ].filter(Boolean); diff --git a/code/frameworks/angular/template/stories/basics/component-with-provided-in/provided-in.stories.ts b/code/frameworks/angular/template/stories/basics/component-with-provided-in/provided-in.stories.ts deleted file mode 100644 index a611182ead1..00000000000 --- a/code/frameworks/angular/template/stories/basics/component-with-provided-in/provided-in.stories.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Component } from '@angular/core'; -import { NgxsModule } from '@ngxs/store'; -import { Meta, moduleMetadata, StoryFn } from '@storybook/angular'; - -@Component({ - selector: 'app-test', - template: `hello`, -}) -class TestComponent {} - -export default { - component: TestComponent, - decorators: [ - moduleMetadata({ - imports: [NgxsModule.forRoot([])], - }), - ], -} as Meta; - -const Template: StoryFn = (args: TestComponent) => ({ - props: args, -}); - -export const Ngxs = Template.bind({}); diff --git a/code/frameworks/angular/template/stories/others/app-initializer-use-factory/app-initializer-use-factory.stories.ts b/code/frameworks/angular/template/stories/others/app-initializer-use-factory/app-initializer-use-factory.stories.ts new file mode 100644 index 00000000000..2dc73b7ad3a --- /dev/null +++ b/code/frameworks/angular/template/stories/others/app-initializer-use-factory/app-initializer-use-factory.stories.ts @@ -0,0 +1,34 @@ +import { moduleMetadata, Meta } from '@storybook/angular'; +import { APP_INITIALIZER } from '@angular/core'; +import { action } from '@storybook/addon-actions'; +import Button from '../../button.component'; + +const meta: Meta