File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,29 @@ class Person extends Model {
42
42
}
43
43
```
44
44
45
- ** NB ** : * Once your models are defined, you must call ` Config.setup() ` :
45
+ ** NOTE ** : * Once your models are defined, you must call ` Config.setup() ` :
46
46
47
47
``` js
48
48
import { Config } from ' jsorm' ;
49
49
Config .setup ();
50
50
```
51
51
52
+ ### ES6/Typescript Classes
53
+
54
+ ES6 and TypeScript classes do not have an ` inherited ` hook. Because this hook provides critical functionality, you have three options:
55
+
56
+ * Edit your ` .tsconfig ` :
57
+ * Set ` target ` to ` es5 ` .
58
+ * Add ` noEmitHelpers: "true" `
59
+
60
+ * Call the inherited hook manually after each class definition:
61
+ ``` ts
62
+ class Author extends Person { ... }
63
+ Person .inherited (Author );
64
+ ```
65
+
66
+ * Use the ` let Person = Model.extend({ ... }) ` pattern shown above instead of native classes.
67
+
52
68
## Basic Usage
53
69
54
70
### Querying
You can’t perform that action at this time.
0 commit comments