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: docs/_guide/you-will-need.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,11 +73,22 @@ class UserList extends HTMLElement {
73
73
}
74
74
```
75
75
76
-
TypeScript decorators only support _class declarations_ which means you will still need to keep the class name between `class` and `extends`. For example the following will be a SyntaxError:
76
+
TypeScript will need the `useDefineForClassFields` set to `true` for the above to work, alternatively you can use the following syntax with `useDefineForClassFields` kept off:
77
77
78
78
```ts
79
79
@controller
80
-
classextendsHTMLElement {
80
+
classUserListextendsHTMLElement {
81
+
staticget name() { return'UserList' }
82
+
}
83
+
```
84
+
85
+
You'll need to keep the class name either way. TypeScript decorators only support _class declarations_ which require a name between `class` and `extends`. For example the following will be a SyntaxError:
0 commit comments