Story book angular inject a service

Discussão em 'Angular' iniciado por Aravintha Bashyam.c, Janeiro 29, 2025.

  1. 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.

    Continue reading...

Compartilhe esta Página