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
Copy file name to clipboardExpand all lines: pages/Decorators.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -294,13 +294,9 @@ The expression for the property decorator will be called as a function at runtim
294
294
2. The name of the member.
295
295
296
296
> NOTE  A *Property Descriptor* is not provided as an argument to a property decorator due to how property decorators are initialized in TypeScript.
297
-
This is because there is currently no mechanism to describe an instance property when defining members of a prototype, and no way to observe or modify the initializer for a property.
297
+
This is because there is currently no mechanism to describe an instance property when defining members of a prototype, and no way to observe or modify the initializer for a property. The return value is ignored too.
298
298
As such, a property decorator can only be used to observe that a property of a specific name has been declared for a class.
299
299
300
-
If the property decorator returns a value, it will be used as the *Property Descriptor* for the member.
301
-
302
-
> NOTE  The return value is ignored if your script target is less than `ES5`.
303
-
304
300
We can use this information to record metadata about the property, as in the following example:
0 commit comments