Skip to content

ui-router-devtools / lazy / LazyDevtoolsPlugin

Class: LazyDevtoolsPlugin ​

Defined in: ui-router-devtools/src/lazy.ts:41

Records the router from registration; mount(target) loads <ui-router-devtools>, hands it the recorder and appends it to target, and unmount() removes it while the recorder keeps running. Only the recorder loads with the plugin: lit, d3 and the element load on the first mount().

Example ​

ts
import { UIRouter } from '@uirouter/core';
import { LazyDevtoolsPlugin } from 'ui-router-devtools/lazy';

declare const router: UIRouter;

// Before the router starts, so the first transition is recorded.
const devtools = router.plugin(LazyDevtoolsPlugin, { timeResolves: true });

// Later, from a key binding or a button: the panel shows every transition since registration.
await devtools.mount(document.body);

Implements ​

Constructors ​

Constructor ​

ts
new LazyDevtoolsPlugin(router, options?): LazyDevtoolsPlugin;

Defined in: ui-router-devtools/src/lazy.ts:53

Parameters ​

ParameterType
routerUIRouter
options?LazyDevtoolsPluginOptions

Returns ​

LazyDevtoolsPlugin

Properties ​

PropertyModifierTypeDefault valueDescriptionDefined in
namepublicstring'devtools'The plugin's name in the router's plugin registry, shared with DevtoolsPlugin.ui-router-devtools/src/lazy.ts:43
recorderreadonlyRecorderundefinedThe recorder the plugin started; the panel follows it, and reporters can share it.ui-router-devtools/src/lazy.ts:45

Accessors ​

element ​

Get Signature ​

ts
get element(): 
  | UIRouterDevtools
  | undefined;

Defined in: ui-router-devtools/src/lazy.ts:62

The <ui-router-devtools> in the DOM while the plugin is mounted.

Returns ​

| UIRouterDevtools | undefined

Methods ​

dispose() ​

ts
dispose(): void;

Defined in: ui-router-devtools/src/lazy.ts:128

Stops the recorder and unmounts the element.

Returns ​

void

Implementation of ​

UIRouterPlugin.dispose


mount() ​

ts
mount(target): Promise<void>;

Defined in: ui-router-devtools/src/lazy.ts:72

Loads <ui-router-devtools>, hands it the recorder and appends it to target; the panel shows everything recorded since registration. Resolves once the element is in the DOM, or without appending it when unmount() or dispose() comes first. Rejects while the plugin is mounted or mounting, once it is disposed, and when loading or appending fails, which leaves it unmounted.

Parameters ​

ParameterType
targetElement

Returns ​

Promise<void>


unmount() ​

ts
unmount(): void;

Defined in: ui-router-devtools/src/lazy.ts:98

Removes the element and keeps the recorder running, so the next mount() replays it; cancels a mount() still loading.

Returns ​

void