Reputation: 31
I'm trying to build multiple apps on one project in Angular 8, but I have problem with finding modules. It's seems that path is good, but I'm still getting error 'Cannot find module'. Tried to put full path, but it does not worked either. My files structure:
My app.routing.ts file
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home';
import { LoginComponent } from './login';
import { AuthGuard } from './helpers';
const routes: Routes = [
{ path: '', component: HomeComponent, canActivate: [AuthGuard] },
{ path: 'login', component: LoginComponent },
{ path: '**', redirectTo: '' }
];
export const appRoutingModule = RouterModule.forRoot(routes);
Is it possible that I have this problem because of multiple apps in one project, or is the problem somewhere else?
Upvotes: 0
Views: 2196
Reputation: 277
. /home/home.component
The same for your interceptors and pipes. You cannot reference the path to its directories, if there is not an index.ts file which exports the directories contentUpvotes: 1
Reputation: 73
I think you are building multiple project by using ng g application, otherwise you can easily build multiple app in one project by using ng g application
Then you need to export the module in App Module to get that module in child module.
If this is not a solution then plz provide the App routing module
Upvotes: 0