创建module test

ng g ng-alain:module test  //默认在src/app/routes下创建module

angular8 创建module 实现路由懒加载

自动生成ts模块和路由模块

在test模块中创建list列表组件和editb编辑页组件

ng g ng-alain:list lisy -m=test

ng g ng-alain:edit edit -m=test -t=list

angular8 创建module 实现路由懒加载

test路由模块添加路由如下

angular8 创建module 实现路由懒加载

在跟路由模块下

通过loadchildren实现懒加载 点击菜单才去请求页面数据

loadChildren指向test模块

angular8 创建module 实现路由懒加载 

相关文章: