You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If one of the types in union type is an imported class (say TestClass), it does not get defined for the module. When a decorator is added for the property, TS calls __metadata("design:type", test_class_1.TestClass), but test_class_1 is undefined, causing runtime error.
If the class is used elsewhere within the module, it will get properly defined. So an easy workaround is to call new TestClass() somewhere.
If one of the types in union type is an imported class (say TestClass), it does not get defined for the module. When a decorator is added for the property, TS calls
__metadata("design:type", test_class_1.TestClass)
, buttest_class_1
is undefined, causing runtime error.If the class is used elsewhere within the module, it will get properly defined. So an easy workaround is to call
new TestClass()
somewhere.TypeScript Version: 2.2.2
Code
Expected behavior:
Actual behavior:
The text was updated successfully, but these errors were encountered: