ctx.navigateByUrl error Ionic Angular

Hello everyone, I’m trying to build an application with Ionic angular so I created pages with the command “ionic generate page”. And after that, I’m modifying my app-routing-module.ts file in the correct path.

But my problem is started when I tried to create a sub-pages like test>subtest folders. I checked subtest folders that have proper paths for component modules.

And in the parent page HTML file I’m trying to route the application with the “navigateByUrl(/sub-test)” command. But even if I worked before when I tried that same method on subpages like the example I was given, It gives a console error like “ERROR TypeError: ctx.navigateByUrl is not a function”

Can anybody help me with this? I really need to learn why I’m causing this error?

Could you post your code?
I am using router.navigate
example:
this.router.navigate([
“/”,
“tabs”,
“landing”,
“school-search”,
“school-form”,
id,
]);
}

Actually, I found my error yesterday late at night. I wasn’t using navigate function inside of the sub-test.ts file.