Skip to content

Commit d002ef7

Browse files
authored
Merge pull request #177 from jamescdavis/revert_fix_beta_build
Revert "Fix beta build"
2 parents ca0660d + 0176a44 commit d002ef7

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

src/markdown/tutorial/part-1/08-working-with-data.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,23 +348,21 @@ The last change we'll need to make is to our `index.hbs` route template, where w
348348
349349
Let's see how.
350350

351-
<!-- Workaround for https://github.com/emberjs/ember.js/issues/19334 -->
352-
353351
```run:file:patch lang=handlebars cwd=super-rentals filename=app/templates/index.hbs
354352
@@ -8,5 +8,5 @@
355353
<ul class="results">
356354
- <li><Rental @rental={{@model}} /></li>
357355
- <li><Rental @rental={{@model}} /></li>
358356
- <li><Rental @rental={{@model}} /></li>
359-
+ {{#each @model as |property|}}
360-
+ <li><Rental @rental={{property}} /></li>
357+
+ {{#each @model as |rental|}}
358+
+ <li><Rental @rental={{rental}} /></li>
361359
+ {{/each}}
362360
</ul>
363361
```
364362

365363
We can use the `{{#each}}...{{/each}}` syntax to iterate and loop through the array returned by the model hook. For each iteration through the array&mdash;for each item in the array&mdash;we will render the block that is passed to it once. In our case, the block is our `<Rental>` component, surrounded by `<li>` tags.
366364

367-
Inside of the block we have access to the item of the *current* iteration with the `{{property}}` variable. But why `property`? Well, because we named it that! This variable comes from the `as |property|` declaration of the `each` loop. We could have just as easily called it something else, like `as |rental|`, in which case we would have to access the current item through the `{{rental}}` variable.
365+
Inside of the block we have access to the item of the *current* iteration with the `{{rental}}` variable. But why `rental`? Well, because we named it that! This variable comes from the `as |rental|` declaration of the `each` loop. We could have just as easily called it something else, like `as |property|`, in which case we would have to access the current item through the `{{property}}` variable.
368366

369367
Now, let's go over to our browser and see what our index route looks like with this change.
370368

src/markdown/tutorial/part-2/12-provider-components.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ Wait...why don't we just refactor the search box into a component? Once we do th
5858

5959
Let's start simple again and begin our refactor by creating a new template for our component, which we will call `rentals.hbs`.
6060

61-
<!-- Workaround for https://github.com/emberjs/ember.js/issues/19334 -->
62-
6361
```run:file:create lang=handlebars cwd=super-rentals filename=app/components/rentals.hbs
6462
<div class="rentals">
6563
<label>
@@ -68,8 +66,8 @@ Let's start simple again and begin our refactor by creating a new template for o
6866
</label>
6967
7068
<ul class="results">
71-
{{#each @rentals as |property|}}
72-
<li><Rental @rental={{property}} /></li>
69+
{{#each @rentals as |rental|}}
70+
<li><Rental @rental={{rental}} /></li>
7371
{{/each}}
7472
</ul>
7573
</div>
@@ -87,8 +85,8 @@ There is one minor change to note here: while extracting our markup into a compo
8785
- </label>
8886
-
8987
- <ul class="results">
90-
- {{#each @model as |property|}}
91-
- <li><Rental @rental={{property}} /></li>
88+
- {{#each @model as |rental|}}
89+
- <li><Rental @rental={{rental}} /></li>
9290
- {{/each}}
9391
- </ul>
9492
-</div>
@@ -285,12 +283,12 @@ Well, in order to answer this question, let's look at how the data that we're yi
285283
```run:file:patch lang=handlebars cwd=super-rentals filename=app/components/rentals.hbs
286284
@@ -7,5 +7,7 @@
287285
<ul class="results">
288-
- {{#each @rentals as |property|}}
289-
- <li><Rental @rental={{property}} /></li>
286+
- {{#each @rentals as |rental|}}
287+
- <li><Rental @rental={{rental}} /></li>
290288
- {{/each}}
291289
+ <Rentals::Filter @rentals={{@rentals}} @query={{this.query}} as |results|>
292-
+ {{#each results as |property|}}
293-
+ <li><Rental @rental={{property}} /></li>
290+
+ {{#each results as |rental|}}
291+
+ <li><Rental @rental={{rental}} /></li>
294292
+ {{/each}}
295293
+ </Rentals::Filter>
296294
</ul>

0 commit comments

Comments
 (0)