Okay we all hate boilerplate. It sucks. AutoComplete and Hints help a ton! But what happens when that is STILL more typing to get the right Intellisense instead of just using a helper class to construct an object for you that meets the requirements of the route object?
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AComponent } from './a/a.component';
import { BComponent } from './b/b.component';
class Route {
constructor(public path: string, public component: any) {}
}
const routes: Routes = [
new Route('', AComponent),
new Route('b', BComponent),
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
It will work in Angular with ng serve, but with Scully it will not work on any pages except the home route.
Angular Version:
Angular CLI: 9.1.4
Node: 12.13.0
OS: win32 x64
Angular: 9.1.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.901.4
@angular-devkit/build-angular 0.901.4
@angular-devkit/build-optimizer 0.901.4
@angular-devkit/build-webpack 0.901.4
@angular-devkit/core 9.1.4
@angular-devkit/schematics 9.1.4
@angular/cdk 9.2.4
@ngtools/webpack 9.1.4
@schematics/angular 9.1.4
@schematics/update 0.901.4
rxjs 6.5.5
typescript 3.8.3
webpack 4.42.0
Scully Version:
There is only one outputted route:
[{"route":"/"}]
Just curious, what happens when you set up your b route like
new Route('b', BComponent) ?
whoops that is how I set it up. Sorry, it's a little late for me. Fat fingered and slow-minded.
@skatcat31 This is an issue with Guess-parser. Scully is depending on that for route traversal.
There is no actionable content for Scully here, so I'm closing this issue for now.
If you have more insights, please add them here, and we can reopen.