这个提示真的让我有点找不到头绪 build-package下的路由打不开
app.route.ts
import { BuildPackageRoute } from './build-package/build-package.route';
import { PackageRoute } from './package/package.route';
import { UserRoute } from './user/user.route';
export const AppRoute = [
{ path: '', pathMatch: 'full', redirectTo: 'build-package' },
BuildPackageRoute,
PackageRoute,
UserRoute,
];
app.module.ts
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule } from '@angular/router';
import { PipesModule } from "@/pipe/pipe.module";
import { ComponentsModule } from '@/components/components.module';
import { LayoutsModule } from '@/layouts/layouts.module';
import { ApiService } from '@/services/api.service';
import { UtilService } from '@/services/util.service';
import { AppComponent } from './app.component';
import { AppRoute } from './app.route';
@NgModule({
bootstrap: [
AppComponent,
],
declarations: [
AppComponent,
],
imports: [
PipesModule,
BrowserAnimationsModule,
ComponentsModule,
LayoutsModule,
RouterModule.forRoot(AppRoute, { onSameUrlNavigation: 'reload' }),
],
providers: [
ApiService,
UtilService,
],
})
export class AppModule { }
build-paclage.route.ts
export const BuildPackageRoute = {
path: 'build-package',
data: { name: '装箱扫描' },
children: [
{ path: '', pathMatch: 'full', redirectTo: 'add' },
{ path: 'add', data: { name: '添加' }, loadChildren: '@/app/build-package/add/add.module#AddModule' },
],
};
有大神帮忙看看么
解决了 但是还是不太清楚原因 之前app.module.ts中引用了一些没用到的pipe等其他的模块 后来删除了 重新安装依赖 编译 就可以了