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: index.html
+168-4Lines changed: 168 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -572,7 +572,7 @@ <h4 class="exercise-start">
572
572
573
573
<p>In <code>app/app.component.ts</code> replace the current <code>AppComponent</code> declaration with the one shown below, which adds a new <code>email</code> property, and changes the <code>submit()</code> method to display its value:</p>
574
574
<pre><codeclass="lang-TypeScript">export class AppComponent {
<p>Talk about the color module and animation module. Have gifs. Mention that the hint color looks bad, but that we’ll address that later. Transition to talking about the list page.</p>
996
996
<h3id="listview">ListView</h3>
997
+
<p>Talk about what list views are.</p>
998
+
<h4class="exercise-start">
999
+
<b>Exercise</b>: ???
1000
+
</h4>
1001
+
1002
+
<p>Open <code>app/pages/list/list.html</code> and paste in the following code:</p>
<p>We’ll talk about the syntax in a moment, for now concentrate on the new <code>class</code> attribute. Open <code>app/app.css</code> and paste the following code at the bottom of the file:</p>
1010
+
<pre><codeclass="lang-CSS">.small-spacing {
1011
+
margin: 5;
1012
+
}
1013
+
.medium-spacing {
1014
+
margin: 10;
1015
+
}
1016
+
</code></pre>
1017
+
<p>Next, open <code>app/pages/list/list.component.ts</code> and paste in the following code:</p>
1018
+
<pre><codeclass="lang-TypeScript">import {Component, OnInit} from "angular2/core";
<p>Open <code>app/pages/list/list.component.ts</code> and add the following two lines to the top of the file:</p>
1085
+
<pre><codeclass="lang-TypeScript">import {Grocery} from "../../shared/grocery/grocery";
1086
+
import {GroceryListService} from "../../shared/grocery/grocery-list.service";
1087
+
</code></pre>
1088
+
<p>Next, change the existing <code>groceryList</code> declaration to use the newly imported <code>Grocery</code> class instead of a generic <code>Object</code>:</p>
<p>Talk about the code you just added. But then note that if you try the code, you’ll get an exception about no provider for Http. Talk about best practices of where to declare shared providers. Let’s fix the problem now.</p>
1142
+
<h4class="exercise-start">
1143
+
<b>Exercise</b>: ???
1144
+
</h4>
1145
+
1146
+
<p>Open <code>app/pages/login/login.component.ts</code> and <em>remove</em> the following line from the top of the file:</p>
1147
+
<pre><codeclass="lang-TypeScript">import {HTTP_PROVIDERS} from "angular2/http";
1148
+
</code></pre>
1149
+
<p>Next, in the same file, remove <code>HTTP_PROVIDERS</code> from the component decorator’s <code>providers</code> array. The array should now look this like:</p>
0 commit comments