Skip to content

Commit d2da87a

Browse files
authored
Merge pull request #1490 from muziejus/fix-typo
docs: fix typos
2 parents fe48547 + 4f15bc8 commit d2da87a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/ember-data/models.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ The type returned by the `@attr` decorator is whatever [Transform](https://api.e
1111
* If you supply no argument to `@attr`, the value is passed through without transformation.
1212
* If you supply one of the built-in transforms, you will get back a corresponding type:
1313
* `@attr('string')``string`
14-
* `@attr(number)``number`,
14+
* `@attr('number')``number`
1515
* `@attr('boolean')``boolean`
16-
* `@attr'date')``Date`
16+
* `@attr('date')``Date`
1717
* If you supply a custom transform, you will get back the type returned by your transform.
1818

1919
So, for example, you might write a class like this:
@@ -24,7 +24,7 @@ import CustomType from '../transforms/custom-transform';
2424

2525
export default class User extends Model {
2626
@attr()
27-
name?: string;
27+
declare name?: string;
2828

2929
@attr('number')
3030
declare age: number;
@@ -62,7 +62,7 @@ export default class User extends Model {
6262

6363
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.
6464

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:
6666

6767
```ts
6868
import type User from './user';

0 commit comments

Comments
 (0)