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.

does not generate stories when components come from an array in routing module

See original GitHub issue

Current Behavior

nx g @nrwl/angular:stories project-name … –> creates only stories file for SimpleComponent

Expected Behavior

Stories should be created for HasRouteComponent and AlsoHasRouteComponent as well.

Steps to Reproduce

File: abc-routing.module.ts

const routes: Routes = [
  // defines routes for the componts from variable "routedComponents"
]

@NgModule({
  imports: [RouterModule.forChild(routes), NbDialogModule.forChild()],
  exports: [RouterModule],
})
export class AbcRoutingModule {}

export const routedComponents = [
  HasRouteComponent,
  AlsoHasRouteComponent,
];

File: abc.module.ts

@NgModule({
  declarations: [...routedComponents, SimpleComponent],
})
export class AbcModule {}

Environment

Node : 14.17.3
OS   : Win10
npm  : 8.3.0

nx : 13.1.4
"@nrwl/angular": "^13.1.4",
"@nrwl/cli": "13.1.4",
"@nrwl/cypress": "13.1.4",
"@nrwl/eslint-plugin-nx": "13.1.4",
"@nrwl/jest": "13.1.4",
"@nrwl/linter": "13.1.4",
"@nrwl/storybook": "^13.5.3",
"@nrwl/tao": "13.1.4",
"@nrwl/workspace": "13.1.4",
"typescript": "~4.3.5"

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Coly010commented, Apr 19, 2022

Thanks for reporting this!

I can reproduce this on latest, I’ll investigate 🙂

0reactions
mandarinicommented, Jun 23, 2022

Hey @joaorodr84 I’ll go ahead and close this, because I’m pretty sure it’s fixed in the latest version of Nx. If the issue persists, please feel free to reopen!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular router seems to work but doesn't load component
The Angular router renders the loaded component there. Without it, your component class will be instantiated, but it cannot be rendered. Also, ...
Read more >
A Complete Guide To Routing In Angular - Smashing Magazine
Throughout this tutorial, Ahmed Bouchefra introduces Angular Router and how you can use it to create client-side apps and Single Page Apps ...
Read more >
Angular Dynamic Routing - Level Up Coding
A dirty workaround would be to create a fixed number of routes named: step1, step2, step3 and then load the component dynamically in...
Read more >
Avoiding common confusions with modules in Angular
This is because there's no a-comp declared in the App module. If I want to use this component I need to import the...
Read more >
Troubleshooting Angular routing - Medium
Firstly, we should create a routing-module: //app-routing.module.tsconst routes: Routes = [ { path: 'one', component: OneComponent },
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