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/ember-data/models.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,9 @@ The type returned by the `@attr` decorator is whatever [Transform](https://api.e
11
11
* If you supply no argument to `@attr`, the value is passed through without transformation.
12
12
* If you supply one of the built-in transforms, you will get back a corresponding type:
13
13
*`@attr('string')` → `string`
14
-
*`@attr(number)` → `number`,
14
+
*`@attr('number')` → `number`
15
15
*`@attr('boolean')` → `boolean`
16
-
*`@attr'date')` → `Date`
16
+
*`@attr('date')` → `Date`
17
17
* If you supply a custom transform, you will get back the type returned by your transform.
18
18
19
19
So, for example, you might write a class like this:
@@ -24,7 +24,7 @@ import CustomType from '../transforms/custom-transform';
24
24
25
25
exportdefaultclassUserextendsModel {
26
26
@attr()
27
-
name?:string;
27
+
declarename?:string;
28
28
29
29
@attr('number')
30
30
declare age:number;
@@ -62,7 +62,7 @@ export default class User extends Model {
62
62
63
63
Relationships between models in Ember Data rely on importing the related models, like `import User from './user';`. This, naturally, can cause a recursive loop, as `/app/models/post.ts` imports `User` from `/app/models/user.ts`, and `/app/models/user.ts` imports `Post` from `/app/models/post.ts`. Recursive importing triggers an [`import/no-cycle`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md) error from eslint.
64
64
65
-
To avoid these errors, use of [type-only imports](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html), available since TypeScript 3.8:
65
+
To avoid these errors, use [type-only imports](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html), available since TypeScript 3.8:
0 commit comments