compodoc: [BUG] Routes documentation is not generated
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
- No section available - Screenshot
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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (7 by maintainers)
I have the same issue this is my app.routing.ts
Still not render the route options in the documentation. pls help!
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
@vogloblinsky, fixed code as you said but still no Routes section
app.routing.ts
app.module.ts
Yes, watch the demo project : https://compodoc.github.io/compodoc-demo-todomvc-angular/routes.html and the sources : https://github.com/compodoc/compodoc-demo-todomvc-angular