Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

storybook-addon-angular-router

Package Overview
Dependencies
Maintainers
0
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storybook-addon-angular-router

Addon to enable logging and mocking for the angular router in storybook

  • 1.10.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.6K
increased by9.08%
Maintainers
0
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 21 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc