Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-deeply-nested-dependent-keys-with-each: Fix documentation examples #383

Merged
merged 3 commits into from Feb 6, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/rules/no-deeply-nested-dependent-keys-with-each.md
Expand Up @@ -2,7 +2,7 @@

For performance / complexity reasons, Ember does not allow deeply-nested computed property dependent keys with `@each`. At runtime, it will show a warning about this:

> WARNING: Dependent keys containing @each only work one level deep. You used the key "foo.@each.bar.baz" which is invalid. Please create an intermediary computed property.
> WARNING: Dependent keys containing @each only work one level deep. You used the key `"foo.@each.bar.baz"` which is invalid. Please create an intermediary computed property.

## Rule Details

Expand All @@ -18,11 +18,11 @@ Examples of **correct** code for this rule:

```js
displayNames: computed('owners.@each.name', function() {
return this.owners.mapBy(owners, 'name');
return this.owners.mapBy('owner', 'name');
Alonski marked this conversation as resolved.
Show resolved Hide resolved
}),

owners: computed('todos.@each.owner', function() {
return this.todos.mapBy(todo, 'owner');
return this.todos.mapBy('todo', 'owner');
Alonski marked this conversation as resolved.
Show resolved Hide resolved
})
```

Expand Down