我有一个订阅ofActionSuccessful的angular组件。当用户单击页面上的按钮时,将调度此操作。用户可能会多次单击此按钮,从而导致此操作的多个调度事件 console.log('Action Successful'); new UpdateCommunicationPreferences(this.communicat
我想知道为什么没有用于定义操作类型字符串的修饰器,而是每次声明操作名称时都声明一个静态常量/变量。 我是这样想的: function ActionType(type: string) { ctor.type = type;}
class MyAction {
} 我不确定将type添加到构造函数是否等同于静态成员,但我知道在使用装饰器之后,console.log(MyAction.type)会像声明静态成员一样打印Hello Wo