1.10.0 • Published 1 month ago

storybook-addon-angular-router v1.10.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Angular Router Storybook Addon

Storybook npm Release npm

A simple plugin to make working with the angular router in storybook easier

How to use it

Install the addon via npm:

npm i storybook-addon-angular-router

Add it to your storybook configuration:

// .storybook/main.js
module.exports = {
    addons: ["storybook-addon-angular-router"],
};

Every call to navigate and navigateByUrl on the router is now logged in the action panel together with all parameters.

If you want to test the routerLinkActive directive in your story you can set the active route for the story like this:

export const WithActiveLink = Template.bind({});
WithActiveLink.parameters = {
    angularRouter: {active: '/location/1'}
};

If you want to disable the plugin for a single story you can add the following parameter to your story:

export const DisabledPlugin = Template.bind({});
DisabledPlugin.parameters = {
    angularRouter: {disable: true}
}

How it works

The plugin adds the RouterTestingModule and a custom Router implementation to your stories. The custom Router implementation provides only the most basic functionality needed to use it in your stories.

1.10.0

1 month ago

1.9.2

5 months ago

1.9.1

8 months ago

1.8.0

1 year ago

1.7.2-next.2

1 year ago

1.9.0

12 months ago

1.7.2-next.0

1 year ago

1.7.2-next.1

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.2.0

3 years ago

1.3.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago