-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1334 from ember-learn/deprecate-implicit-route-model
Deprecate implict route model
- Loading branch information
Showing
5 changed files
with
93 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Implicit Route Model | ||
until: 6.0.0 | ||
since: 5.3.0 | ||
--- | ||
|
||
Previously, if no `Route#model` hook was specified and a `_id` parameter was present, Ember would attempt to figure out how to load that model for you. Specify your own model hook to load from the store, if desired. | ||
|
||
For example: | ||
|
||
```js | ||
import { Route } from '@ember/routing/route'; | ||
import { service } from '@ember/service'; | ||
|
||
export default class MyModelRoute extends Route { | ||
@service store; | ||
|
||
model({ my_model_id }) { | ||
return this.store.findRecord('my-model', my_model_id); | ||
} | ||
} | ||
``` | ||
|
||
For more background, read the [RFC](https://github.com/snewcomer/rfcs/blob/master/text/0774-implicit-record-route-loading.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters