reactjs - Story book angular inject a service - Stack Overflow

admin2025-04-18  4

Trying to inject a service in to story book angular.

To call a method in angular service.

render: () => ({ props: { uType: 'secondary',

withDelay: (injector: Injector) => { const myService: NotificationService = injector!.get(NotificationService);
myService.show("Hello"); alert("hello"); }

, }, template: <button uAction [uType]="'secondary'" (click)="withDelay(injector)">Show notification</button>,}),

I am trying to call a service method on click of with delay function.

How to inject a real service to storybook.

转载请注明原文地址:http://www.anycun.com/QandA/1744963741a90110.html