ng g module with route option not working with the new provideRouter
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 45/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- angular, typescript
Direção de pesquisa
Reproduza ng g m foo --route=foo -m=app em um projeto Angular 15 usando provideRouter e, em seguida, inspecione o tratamento de rotas da geração de módulos em comparação com app-routing.module.ts e app.module.ts. Está concluído quando o comando encontra a declaração de rotas exportada e gera o módulo com a rota solicitada sem o erro mostrado.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Command
generate
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
when using the new way provideRouter the command ng g m foo --route=foo -m=app stop working
Minimal Reproduction
create new angular 15 project
in app-routing.module.ts
- remove
AppRoutingModule - export the
routesconst
in app.module.ts
- remove
AppRoutingModulefromimportarray - add
provideRouter(routes)to theprovidersarray
then in the command line run ng g m foo --route=foo -m=app
Exception or Error
Couldn't find a route declaration in /src/app/app-routing.module.ts.
Use the '--module' option to specify a different routing module.
Your Environment
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1500.5
@angular-devkit/build-angular 15.0.5
@angular-devkit/core 15.0.5
@angular-devkit/schematics 15.0.5
@angular/cli 15.0.5
@schematics/angular 15.0.5
rxjs 7.5.7
typescript 4.8.4
Anything else relevant?
changing the file name from app-routing.module.ts to routes.ts gives a different but similar error message
Couldn't find a route declaration in /src/app/app.module.ts.
Use the '--module' option to specify a different routing module.
- Linguagem predominante
- TypeScript
- Estrelas
- 27k
- Forks
- 11.8k
- Merge médio
- 16h 35min
- PRs com merge (30d)
- 176
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de angular/angular-cli
-
area: @angular/build gemini-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
angular/angular-cli#33055 · 1 comentário · 3 reações ·
-
unit-test: with --coverage, a setup file's hooks reach only the first spec file of each worker Abertaarea: @angular/build gemini-triaged
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 responsável ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 responsável ·
Todas as issues de angular/angular-cli
Issues semelhantes
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
vicharanashala/fln#563 ·