我想使用一个具有接口"entity“的类"element”。我想使用像c#接口一样的接口。我有一个带有输入的角度组件。输入类型是entity (接口),因为angular组件有两个输入类。我想我可以使用像c#这样的接口,在其中定义我在其他类(例如:" element ")中实现的方法,并在强制转换为接口的element实例上调用此方法。我希望你能理解我想做什么。
我似乎能够阻止它,但我不知道如何等待在Angular 11的AuthGuard中的API调用?我必须让canActivate()方法异步吗?seem to work in Angular11 and I can't get the .pipe() to work either.
} Auth Guard (可以工作,但我不知道如何等待API调用