角延迟加载的组件错误错误:找不到“默认”

时间:2019-07-18 16:51:22

标签: angular lazy-loading angular-module

我已经在生产模式下通过azure devops部署了一个角度应用程序。但是当要去任何延迟加载的组件时,它会给出错误

@GetMapping
public List<Strategy> get(StrategyFilter filter) {
    return noFilterProvided(filter) ? getAll() : search(filter);
}

请注意,如果我重新加载没有index.html的任何页面,则会出现错误:

    ERROR Error: Uncaught (in promise): Error: Cannot find 'default' in 
    './problem/problem.module'
    Error: Cannot find 'default' in './problem/problem.module'

该网站是:https://tritronfront.azurewebsites.net/ 要产生错误,您必须单击导航栏上的问题菜单。

我的延迟加载路线代码是

    The resource you are looking for has been removed, had its name 
    changed, or is temporarily unavailable.

,模块代码为

    { path: 'admin', loadChildren: './admin/admin.module'},
    { path: 'problem', loadChildren: './problem/problem.module'}

1 个答案:

答案 0 :(得分:2)

只是说:

export class ProblemModule { }

您还必须添加一件事:

{ path: 'problem', loadChildren: './problem/problem.module#ProblemModule'}

这在官方文档中 https://angular.io/docs/ts/latest/guide/router.html

相关问题