question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Routes documentation is not generated

See original GitHub issue
Routes doc section is not generated
Operating System, Node.js, npm, compodoc version(s)

1.0.0-beta.13

Node.js version : v6.10.2

Operating system : macOS Sierra

Angular configuration, a package.json file in the root folder
{
  "name": "...",
  "version": "2.0.0-beta.3",
  "license": "MIT",
  "private": true,
  "scripts": {
    "ng": "ng",
    "start": "ng serve --port 8080",
    "start:aot": "ng serve --aot --port 8080",
    "build:prod": "ng build --prod --env=prod --aot",
    "build:dev": "ng build --dev --env=dev --aot",
    "build": "npm run build:prod"
    "test": "ng test --single-run",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "doc": "npm run doc:serve",
    "doc:generate": "compodoc -p ./tsconfig.json",
    "doc:serve": "compodoc -s -r 8090",
    "doc:watch": "compodoc -p ./tsconfig.json -w -s -r 8090"
  },
  "dependencies": {
    "@angular/common": "^4.0.1",
    "@angular/compiler": "^4.0.1",
    "@angular/core": "^4.0.1",
    "@angular/forms": "^4.0.1",
    "@angular/http": "^4.0.1",
    "@angular/platform-browser": "^4.0.1",
    "@angular/platform-browser-dynamic": "^4.0.1",
    "@angular/router": "^4.0.1",
    "@compodoc/compodoc": "^1.0.0-beta.13",
    "core-js": "^2.4.1",
    "es6-shim": "^0.35.3",
    "fuse-js-latest": "^2.6.2",
    "jquery": "^3.2.1",
    "karma-phantomjs-launcher": "^1.0.4",
    "lodash": "^4.17.4",
    "moment": "^2.18.1",
    "ng2-toasty": "^2.5.0",
    "ng2-validation": "^4.2.0",
    "ngx-bootstrap": "next",
    "node-sass": "^4.5.3",
    "normalize-url": "^1.9.1",
    "phantomjs-prebuilt": "^2.1.14",
    "reflect-metadata": "^0.1.3",
    "rxjs": "^5.0.1",
    "zone.js": "^0.8.5"
  },
  "devDependencies": {
    "@angular/cli": "1.0.3",
    "@angular/compiler-cli": "^4.0.1",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.5.0",
    "typescript": "~2.2.0"
  }
}

Project files:

app.routing.ts

import { RouterModule, Routes } from '@angular/router';

import { AuthComponent } from './auth/auth.component';
import { DashboardComponent } from './dashboard/dashboard.component';

const APP_ROUTES: Routes = [
  {
    path: '',
    component: ContainerComponent,
    canActivate: [LoggedInGuard],
    children: [
      {
        path: 'dashboard',
        component: DashboardComponent,
        data: {
          title: 'Dashboard'
        }
      }
    ]
  },
  {
    path: 'auth',
    component: AuthComponent,
    data: {
      title: 'Authorization'
    }
  },
  {
    path: '**',
    redirectTo: '/dashboard'
  }
];

export const routing = RouterModule.forRoot(APP_ROUTES);

app.module.ts

import { NgModule, ApplicationRef } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

import { AppComponent } from './app.component';

// Dashboard
import { DashboardComponent } from './dashboard/dashboard.component';
import { VectorMapComponent } from './dashboard/vector-map/vector-map.component';

// App modules
import { AuthModule } from './auth';
import { ContainerModule } from './container/container.module';

import { routing } from './app.routing';


@NgModule({
  imports: [
    BrowserModule,
    HttpModule,
    FormsModule,
    routing, // routing
    ReactiveFormsModule,
    AuthModule,
    ContainerModule
  ],
  declarations: [
    AppComponent,
    VectorMapComponent,
    DashboardComponent
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {
  constructor(public appRef: ApplicationRef) {}
}
Compodoc installed globally or locally ?

Localy

Motivation for or Use Case
Reproduce the error

Steps

  • Create a new project via ng cli
  • Use app module and routing file from example above
  • Generate documentation

Expected

  • Routes section generated and presented

Got

Notes: Also I’ve tried to call RouterModule.forRoot(APP_ROUTES) in app.module.ts file but still had the same behavior

Related issues
Suggest a Fix

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
wkjesuscommented, Feb 6, 2018

I have the same issue this is my app.routing.ts

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

// Import Containers
import { FullLayoutComponent, SimpleLayoutComponent } from './containers';
import { AuthGuard } from 'app/guards/Auth.guard';

export const APP_ROUTES: Routes = [
  {
    path: '',
    redirectTo: 'dashboard',
    pathMatch: 'full',
  },
  {
    canActivate: [AuthGuard],
    path: '',
    component: FullLayoutComponent,
    data: {
      title: 'Home',
    },
    children: [
      {
        path: 'talleres',
        data: {
          title: 'Talleres',
        },
        loadChildren: './modules/taller/taller.module#TallerModule',
      },
      {
        path: 'dashboard',
        loadChildren: './modules/dashboard/dashboard.module#DashboardModule',
      },
    ],
  },
  {
    path: 'login',
    component: SimpleLayoutComponent,
    data: {
      title: 'Login',
    },
    children: [
      {
        path: '',
        loadChildren: './modules/login/login.module#LoginModule',
      },
    ],
  },
];

@NgModule({
  imports: [RouterModule.forRoot(APP_ROUTES, { useHash: true })],
  exports: [RouterModule],
})
export class AppRoutingModule {}

Still not render the route options in the documentation. pls help!

1reaction
vogloblinskycommented, Nov 20, 2017

Bug fixed for dynamic path and pathMatch for route definition. Need to work on other parts of route description : angular.io/api/router/Routes#description

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting and Debugging - Scribe documentation
Update your installation¶. First off, try updating your installed Scribe version. Maybe your problem is due to a bug we've fixed in a...
Read more >
Router tutorial: tour of heroes - Angular
Generate the CrisisList and HeroList components so that the router has something ... A wildcard route can navigate to a custom "404 Not...
Read more >
Google Maps Platform FAQ
Yes, Google Maps, Routes, Places services can be used with private-access ... Adding a marker will not generate additional map loads, but may...
Read more >
Troubleshooting network analyses—ArcMap | Documentation
Route solver · At least two stops per route are required to solve. · No solution if no route is found. · If...
Read more >
Configuring Routes and Domains | Cloud Foundry Docs
Developers can map a route to their app with the cf push command. If a domain or hostname is not specified, then a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found