0
내 비동기 경로로드를 다음과 같이 변경했습니다.이름을 찾을 수 없습니다 시스템 각도 2 webpack 2
import { Routes } from '@angular/router';
import { RoleModel, ConfigurationResolverService } from '../shared/services';
import { UnitMaintenancePage } from '../unit-maintenance.page/unit-maintenance.page'; import { TimeEntryPage } from '../time-entry.page/time-entry.page'; import { LayoutMainPage } from './layout-main.page'; import { DashboardPage } from '../dashboard.page/dashboard.page'; import { PayTypesPage } from '../pay-types.page/pay-types.page'; import { LayoutMainAuthGuardService } from './layout-main-auth-guard.service';
/** * Here are the application routes */
export const layoutMainRoutes: Routes = [
{
path: '',
component: LayoutMainPage,
canActivate: [LayoutMainAuthGuardService],
data: { roles: [RoleModel.ADMIN] },
// canActivate: [ActivateRouteGuardService],
children: [
{
path: '',
loadChildren:() => System.import('../dashboard.page/dashboard.module').then(module => module['DashboardModule'])
},
{
path: 'holiday-maintenance',
loadChildren:() => System.import('../holiday-maintenance.page/holiday-maintenance.module').then(module
=> module['HolidayMaintenanceModule'])
},
{
path: 'unit-maintenance',
loadChildren:() => System.import('../unit-maintenance.page/unit-maintenance.module').then(module
=> module['UnitMaintenanceModule'])
},
{
path: 'time-entry',
loadChildren:() => System.import('../time-entry.page/time-entry.module').then(module => module['TimeEntryModule'])
},
{
path: 'shift-maintenance',
loadChildren:() => System.import('../shift-maintenance.page/shift-maintenance.module').then(module
=> module['ShiftMaintenanceModule'])
},
{
path: 'pay-types',
loadChildren:() => System.import('../pay-types.page/pay-types.module').then(module => module['PayTypesModule'])
},
{
path: 'category-maintenance',
loadChildren:() => System.import('../category-maintenance.page/category-maintenance.module').then(module
=> module['CategoryMaintenanceModule'])
},
{
path: 'employee-maintenance',
loadChildren:() => System.import('../employee-maintenance.page/employee-maintenance.module').then(module
=> module['EmployeeMaintenanceModule'])
},
{
path: 'employee-overrides',
loadChildren:() => System.import('../employee-overrides.page/employee-overrides.module').then(module
=> module['EmployeeOverridesModule'])
},
{
path: 'timekeeper-maintenance',
loadChildren:() => System.import('../timekeeper.page/timekeeper.module').then(module => module['TimekeeperMaintenanceModule'])
},
{
path: 'sub-category',
loadChildren:() => System.import('../sub-category.page/sub-category.module').then(module
=> module['SubCategoryModule'])
},
{
path: 'function-maintenance',
loadChildren:() => System.import('../function-maintenance.page/function-maintenance.module').then(module
=> module['FunctionMaintenanceModule'])
}
]
} ];
웹팩이 제안했지만 여전히 오류가 있습니다.
[at-loader] Checking finished with 12 errors
Error in bail mode: [at-loader] src\app\layout-main.page\layout-main.routes.ts:26:37
Cannot find name 'System'.
나는
@types/systemjs
를 설치했는데이 사람이 문제가 어디에서 알 수 있습니까 그것은에 영향을하지 않는 것?
내가 아는 한 System은 SystemJS 여야합니다. 당신은'@ types/systemjs'를 살펴보고 글을 쓰게 될 것입니다. – Dinistro
to index.html – Verri
빌드 작업, 그리고 난 전혀 시스템 js를 사용하지 마십시오 내가 라우터 로더가 제안했기 때문에 이걸 바꿨어. 그리고 여전히 작동하는데, 왜 내가이 오류가 발생하는지 이해하지 못합니다. 이벤트를 내가 '../function-maintenance.page/function-maintenance.module#FunctionMaintenanceModule'과 같이 inported하게 만들면 오류가 발생합니다. – Nicu