Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Angular Route Parsing Error #680

Closed
gseok opened this issue Oct 26, 2018 · 4 comments
Closed

[BUG] Angular Route Parsing Error #680

gseok opened this issue Oct 26, 2018 · 4 comments

Comments

@gseok
Copy link

gseok commented Oct 26, 2018

Overview of the issue

image

My angular route file using const value, this time compodoc error...

e.g) my-module-routing.module.ts

// These example code ERROR
import { NgModule } from '@angular/core';
import {
  Routes,
  RouterModule
} from '@angular/router';
import { AComponent } from './components/myComponent/A.component';
import { BComponent } from './components/myComponent/B.component';
import {
  ROUTE_PATH
} from './module.setting';

const routes: Routes = [
  {
    path: ROUTE_PATH.A,
    component: A,
  },
  {
    path: ROUTE_PATH.B,
    component: B,
  },

My route using param

// module.setting
export const ROUTE_PATH: any = {
  A: 'add/:data',
  B: 'remove/:id/:data',
};

Using Hard Coding then do not Error.

// These example success
import { NgModule } from '@angular/core';
import {
  Routes,
  RouterModule
} from '@angular/router';
import { AComponent } from './components/myComponent/A.component';
import { BComponent } from './components/myComponent/B.component';

const routes: Routes = [
  {
    path: 'add/:data',
    component: A,
  },
  {
    path: 'remove/:id/:data',
    component: B,
  },

I want to using const (setting). but This time error occured.

Operating System, Node.js, npm, compodoc version(s)
  • macOS
  • node v10.12.0
  • "@compodoc/compodoc": "^1.1.5",
Angular configuration, a package.json file in the root folder
// package.json
  "dependencies": {
    "@angular/animations": "6.1.6",
    "@angular/cdk": "^6.4.7",
    "@angular/common": "6.1.6",
    "@angular/compiler": "6.1.6",
    "@angular/core": "6.1.6",
    "@angular/forms": "6.1.6",
    "@angular/http": "6.1.6",
    "@angular/material": "^6.4.7",
    "@angular/platform-browser": "6.1.6",
    "@angular/platform-browser-dynamic": "6.1.6",
    "@angular/router": "6.1.6",
    "@turf/turf": "^5.1.6",
    "@types/geojson": "^7946.0.4",
    "@types/moment": "^2.13.0",
    "@types/ua-parser-js": "^0.7.32",
    "core-js": "^2.5.4",
    "moment": "^2.22.2",
    "ngx-color-picker": "^6.6.0",
    "rxjs": "6.3.1",
    "ua-parser-js": "^0.7.18",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.7.4",
    "@angular/cli": "6.1.5",
    "@angular/compiler-cli": "6.1.6",
    "@angular/language-service": "6.1.6",
    "@compodoc/compodoc": "^1.1.5",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~10.7.1",
    "codelyzer": "~4.4.4",
    "del": "^3.0.0",
    "jasmine-core": "~3.2.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^1.3.0",
    "karma-phantomjs-launcher": "^1.0.4",
    "path": "^0.12.7",
    "phantomjs": "^2.1.7",
    "phantomjs-prebuilt": "^2.1.16",
    "pn": "^1.1.0",
    "protractor": "~5.4.0",
    "spritesmith": "^3.3.0",
    "ts-node": "~7.0.1",
    "tslint": "~5.11.0",
    "typescript": "~2.9.2",
    "webpack-bundle-analyzer": "^3.0.3"
  }
Compodoc installed globally or locally ?

locally

If possible sourcecode of the file where it breaks
If possible your terminal logs before the error
Motivation for or Use Case
Reproduce the error

always

Related issues
Suggest a Fix

parsing the constants...

Arinono added a commit to UReflect/web that referenced this issue Oct 29, 2018
Trying to comply with compodoc which contains several issues reported about usage of objects in
routes defenitions. See compodoc/compodoc#680 or
compodoc/compodoc#661 and many others
(https://github.com/compodoc/compodoc/projects/3)
@vogloblinsky vogloblinsky changed the title [BUG] Angular Route Pasing Error [BUG] Angular Route Parsing Error Nov 28, 2018
@merobal
Copy link

merobal commented Jan 22, 2019

I had the same issue. The trick is it works good if I set the type of the const as Route[] instead of Routes. However Routes is a valid alias as per export declare type Routes = Route[]; from the @angular/routes package, so I would expect this bug to be fixed.

@stale
Copy link

stale bot commented Sep 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 30, 2019
@stale
Copy link

stale bot commented Oct 7, 2019

This issue has been automatically closed because it has not had recent activity. Please file a new issue if you are encountering a similar or related problem. Thank you for your contributions.

@stale stale bot closed this as completed Oct 7, 2019
@lock
Copy link

lock bot commented Dec 6, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. Why locking ? Having issues with the most up-to-date context.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Routing issues
Awaiting triage
Development

No branches or pull requests

3 participants