Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

Jakob-em/storybook-addon-angular-router

Repository files navigation

StorybooknpmReleasenpm

A simple plugin to make working with the angular routerin 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.jsmodule.exports={addons:["storybook-addon-angular-router"],};

Every call tonavigate andnavigateByUrl on the router is now logged in the actionpanel together with all parameters.

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

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

If you want todisable the plugin for a single story you canadd the following parameter to your story:

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

How it works

The plugin adds theRouterTestingModule and a customRouter implementation to your stories.The customRouter implementation providesonly the most basic functionality needed to use it in your stories.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp