Skip to content

Commit 750f33a

Browse files
committed
Minor tweaks to 4.2
1 parent 04ae9af commit 750f33a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ <h4 class="exercise-start">
13411341
JS: Error: DI Exception
13421342
JS: at NoProviderError.BaseException [as constructor] (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/facade/exceptions.js:16:23)
13431343
JS: at NoProviderError.AbstractProviderError [as constructor] (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/core/di/exceptions.js:38:16)
1344-
</code></pre><p>The problem here is your new <code>GroceryListService</code> uses the <code>Http</code> service, but that <code>Http</code> service is never included in your component’s <code>providers</code> array. You could add <code>HTTP_PROVIDERS</code> to this array, as you did in <code>login.component.ts</code>, but it seems a little silly to add <code>HTTP_PROVIDERS</code> to every page that you build. And as it turns out, Angular 2 providers a simpler way of handling this, by allowing you to add common providers to parent components.</p>
1344+
</code></pre><p>The problem here is your new <code>GroceryListService</code> uses the <code>Http</code> service, but that <code>Http</code> service is never included in your component’s <code>providers</code> array. You could add <code>HTTP_PROVIDERS</code> to this array, as you did in <code>login.component.ts</code>, but it seems a little silly to add <code>HTTP_PROVIDERS</code> to every page that you build. And as it turns out, Angular 2 has a simpler way of handling this, by allowing you to add common providers to parent components.</p>
13451345
<h4 class="exercise-start">
13461346
<b>Exercise</b>: Declaring providers
13471347
</h4>
@@ -1366,7 +1366,7 @@ <h4 class="exercise-start">
13661366
<p>If you load the list page with the account you created earlier you’ll see a blank page, as your account is newly created, and therefore your grocery list is empty. If you want to see some data to verify your changes worked, try logging in with the credentials “user@nativescript.org” and “password”. You should some data that looks something like this:</p>
13671367
<p><img src="images/chapter4/android/4.png" alt="Grocery data on Android">
13681368
<img src="images/chapter4/ios/4.png" alt="Grocery data on iOS"></p>
1369-
<p>At this point you have a list of data associated with each account that you display in a list view control, but a grocery list isn’t very useful if you can’t add to the list. Let’s look at how to do that next.</p>
1369+
<p>At this point you have a list of data associated with each account, but a grocery list isn’t very useful if you can’t add new groceries to the list. Let’s look at how to do that next.</p>
13701370
<h3 id="gridlayout">GridLayout</h3>
13711371
<p>In order to allow users to add to their grocery lists you need to add a few additional UI controls to the list page. While you could layout these elements with a <code>&lt;StackLayout&gt;</code>, let’s look at how to create a slightly more complex layout using the <code>&lt;GridLayout&gt;</code> element.</p>
13721372
<h4 class="exercise-start">

src/chapters/chapter4.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ JS: at NoProviderError.BaseException [as constructor] (/data/data/org.native
354354
JS: at NoProviderError.AbstractProviderError [as constructor] (/data/data/org.nativescript.groceries/files/app/tns_modules/angular2/src/core/di/exceptions.js:38:16)
355355
```
356356

357-
The problem here is your new `GroceryListService` uses the `Http` service, but that `Http` service is never included in your components `providers` array. You could add `HTTP_PROVIDERS` to this array, as you did in `login.component.ts`, but it seems a little silly to add `HTTP_PROVIDERS` to every page that you build. And as it turns out, Angular 2 providers a simpler way of handling this, by allowing you to add common providers to parent components.
357+
The problem here is your new `GroceryListService` uses the `Http` service, but that `Http` service is never included in your components `providers` array. You could add `HTTP_PROVIDERS` to this array, as you did in `login.component.ts`, but it seems a little silly to add `HTTP_PROVIDERS` to every page that you build. And as it turns out, Angular 2 has a simpler way of handling this, by allowing you to add common providers to parent components.
358358

359359
<h4 class="exercise-start">
360360
<b>Exercise</b>: Declaring providers
@@ -395,7 +395,7 @@ If you load the list page with the account you created earlier you’ll see a bl
395395
![Grocery data on Android](images/chapter4/android/4.png)
396396
![Grocery data on iOS](images/chapter4/ios/4.png)
397397

398-
At this point you have a list of data associated with each account that you display in a list view control, but a grocery list isnt very useful if you cant add to the list. Lets look at how to do that next.
398+
At this point you have a list of data associated with each account, but a grocery list isnt very useful if you cant add new groceries to the list. Lets look at how to do that next.
399399

400400
### GridLayout
401401

0 commit comments

Comments
 (0)