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: TUTORIALS.md
+22-18Lines changed: 22 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -260,28 +260,35 @@ EmberJS applications roughly follow the Web-MVC pattern. The applications have
260
260
261
261
```sh
262
262
edi ember generate model book title:string isbn:string
263
-
edi ember generate route book
264
-
edi ember generate controller book
263
+
edi ember generate route books
264
+
edi ember generate controller books
265
265
```
266
266
267
267
The terminal output shows the created and updated files. (note: generating new files can make watched files fail in Docker, just kill and restart eds should that happen.)
268
268
269
-
We will fetch all books and render them in our template. In routes/book.js:
269
+
We will fetch all books and render them in our template. In routes/books.js:
270
270
271
271
```diff
272
+
= import Route from '@ember/routing/route';
273
+
+ import { inject as service } from '@ember/service';
274
+
=
272
275
= export default class BooksRoute extends Route {
276
+
+ @service store;
277
+
+
273
278
+ model(){
274
279
+ return this.store.findAll('book');
275
280
+ }
276
281
= }
277
282
```
278
283
279
-
We’ll display the found records in our template so we’re able to see the created records later on. Add the following to templates/book.hbs
284
+
We’ll display the found records in our template so we’re able to see the created records later on. Add the following to templates/books.hbs
0 commit comments