1

Is there any way to load module conditionally or prevent module access in some conditions? I just want to load modules and its subroutes only a specific condition satisfied.

The possible solution I tried till now

  1. Lazy load modules with routing details.
  2. canActivate with auth mechanism service.

Is there any effective way to achieve the same so that.

  1. Common features should not be duplicated.
  2. Module with routing details should be only loaded when in need.

Any help in this regard appreciated TIA.

4

1 回答 1

2

检查CanLoad 防护

一个类可以实现的接口,作为决定是否可以加载子级的守卫。

于 2017-11-29T18:11:49.100 回答