Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ionic g page child doesn't update nearest routing module #118

Open
hugoblanc opened this issue Apr 3, 2019 · 3 comments
Open

ionic g page child doesn't update nearest routing module #118

hugoblanc opened this issue Apr 3, 2019 · 3 comments

Comments

@hugoblanc
Copy link

Description:
I'm generating module with --routing option.
If I generate child page to this module, routing.module.ts is marked as updated but in fact it is not.

Steps to Reproduce:

ionic start errorgene blank
cd errorgene
ionic g module todos --routing
ionic g page todos/todos-list

Output:

For the following command ionic g page todos/todos-list

CREATE src/app/todos/todos-list/todos-list.module.ts (559 bytes)
CREATE src/app/todos/todos-list/todos-list.page.html (129 bytes)
CREATE src/app/todos/todos-list/todos-list.page.spec.ts (713 bytes)
CREATE src/app/todos/todos-list/todos-list.page.ts (271 bytes)
CREATE src/app/todos/todos-list/todos-list.page.scss (0 bytes)
UPDATE src/app/todos/todos-routing.module.ts (248 bytes)
[OK] Generated page!

but todos-routing.module.ts is not updated

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

const routes: Routes = [];

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

My ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (C:\Users\hugob\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.1.2
   @angular-devkit/build-angular : 0.13.7
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.7
   @ionic/angular-toolkit        : 1.4.1

System:

   NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10
@imhoffd imhoffd transferred this issue from ionic-team/ionic-cli Apr 4, 2019
@imhoffd
Copy link
Contributor

imhoffd commented Apr 4, 2019

@hugoblanc Is app-routing.module.ts modified instead?

@hugoblanc
Copy link
Author

Sorry for delay

nop, nothing has changed in app-routing.module.ts

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

const routes: Routes = [ { path: '', redirectTo: 'home', pathMatch: 'full' }, { path: 'home', loadChildren: './home/home.module#HomePageModule' }, ];

@NgModule({ imports: [ RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) ], exports: [RouterModule] })
export class AppRoutingModule { }

@hersonls
Copy link

@hugoblanc I'm having the same problem. I did some tests and I believe it's some parser validation, because when my array is empty it's not added, but when I put any object in the array, the path is added. For example:

Before:
Screen Shot 2021-11-28 at 11 38 55

ionic generate page profile/detail --route-path=detail

Screen Shot 2021-11-28 at 11 46 44

Nothing happen, but after adding this:

Screen Shot 2021-11-28 at 11 39 05

And executing again:

ionic generate page profile/detail --route-path=detail

Screen Shot 2021-11-28 at 11 42 41

And it's work. My module structure is:

Screen Shot 2021-11-28 at 11 45 24

I think it might help us find the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants