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 {
4242}
4343```
4444
45- ** NB ** : * Once your models are defined, you must call ` Config.setup() ` :
45+ ** NOTE ** : * Once your models are defined, you must call ` Config.setup() ` :
4646
4747``` js
4848import { Config } from ' jsorm' ;
4949Config .setup ();
5050```
5151
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+
5268## Basic Usage
5369
5470### Querying
You can’t perform that action at this time.
0 commit comments