Angular 在所有模块组件上运行函数
我有以下配置:Angular 在所有模块组件上运行函数,angular,typescript,Angular,Typescript,我有以下配置: -channel.module.ts -channel.component.ts -channel.component.html - ... -组件1 -component1.component.ts -组件2 -组件2.component.ts 所有子组件都从channel.component.html继承视图。 所以,我想检查当用户想要访问所有通道模块子组件并将其重定向到特定页面时,他是否有一些特权 我想在channel.component.ts的ngOnInit中实现验证,
-channel.module.ts
-channel.component.ts
-channel.component.html
- ...
-组件1
-component1.component.ts
-组件2
-组件2.component.ts
所有子组件都从channel.component.html继承视图。
所以,我想检查当用户想要访问所有通道模块子组件并将其重定向到特定页面时,他是否有一些特权
我想在channel.component.ts的ngOnInit中实现验证,但这只是第一次运行
你知道这个成就吗
考虑到可能需要在路线上使用警卫components@AshishRanjan谢谢你,这很有效!可能需要在路线上使用警卫components@AshishRanjan谢谢你,这很有效!