Skip to content

a bug of visualizer.d.ts for ng2  #32

Description

@zhongsigang

In node_modules/@uirouter/visualizer/lib/visualizer.d.ts:

import { UIRouter, UIRouterPlugin } from "@uirouter/core";
should be:
import { UIRouter, UIRouterPlugin } from "@uirouter/angular";

If not, the following code will not be compiled:

import {UIRouter} from "@uirouter/angular";
import {Visualizer} from "@uirouter/visualizer";

/** UIRouter Config  */
export function uiRouterConfigFn(router: UIRouter) {
  router.urlService.rules.otherwise({state: 'hello'});

  router.plugin(Visualizer);
}

And the error message is:
ERROR in .../src/app/config/router.config.ts (11,17): Argument of type 'typeof Visualizer' is not assignable to parameter of type 'PluginFactory<UIRouterPlugin>'. Type 'typeof Visualizer' provides no match for the signature '(router: UIRouter, options?: any): UIRouterPlugin'.
Because the UIRouter comes from different files, although they have the same contents.

dependencies:

  "@angular/animations": "^4.0.0",
  ...
  "@uirouter/angular": "^1.0.0-beta.7",
  "@uirouter/visualizer": "^4.0.2",

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions