首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到名字系统角2 webpack 2

找不到名字系统角2 webpack 2
EN

Stack Overflow用户
提问于 2017-01-19 11:39:58
回答 1查看 830关注 0票数 0

我将异步路径加载更改为如下所示。

代码语言:javascript
复制
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'])
            }
        ]
    } ];

Webpack提出了这个建议,但我在检查时仍有错误。

代码语言:javascript
复制
[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,但是它似乎对它没有影响,有人知道这个问题在哪里吗?

EN

回答 1

Stack Overflow用户

发布于 2017-02-03 08:15:50

我删除了我的typings.json和键入文件夹,然后重新安装了所有的东西。Webpack现在在工作,但我不明白为什么打字文件夹与配置有冲突,谁能解释一下原因吗?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41740911

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档