Skip to content

Commit a91e7c3

Browse files
committed
A bit more of routing explained
1 parent c9bdece commit a91e7c3

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,9 +942,14 @@ <h4 class="exercise-start">
942942
</code></pre>
943943
<div class="exercise-end"></div>
944944

945-
<p>Let’s actually log the user in then, shall we?</p>
945+
<p>The main new concept here is the <code>@RouteConfig</code> decorator, which you use to provide a list of all routes that are present in your app. Currently you only have one route, which is why <code>@RouteConfig</code> contains a single entry.</p>
946+
<blockquote>
947+
<p><strong>TIP</strong>: If you haven’t played with Angular 2 routing before, you can refer to <a href="https://angular.io/docs/ts/latest/tutorial/toh-pt5.html">Angular’s tutorial on the topic</a> for some background.</p>
948+
</blockquote>
949+
<p>The other new concept in this example is <code>&lt;page-router-outlet&gt;</code>, which is your app’s first directive. You can check out Angular’s docs for <a href="https://angular.io/docs/ts/latest/api/core/Directive-decorator.html">details on what directives do</a>, but the simplest way to think of them is as something that can affect the markup you put in your <code>template</code>—in this case <code>&lt;page-router-outlet&gt;</code>.</p>
950+
<p>Angular 2 provides a <code>&lt;router-outlet&gt;</code> directive for web apps, and NativeScript extends that directive with its own <code>&lt;page-router-outlet&gt;</code> directive that handles the unique environment of iOS and Android apps. To see how it works lets add another page.</p>
946951
<h4 class="exercise-start">
947-
<b>Exercise</b>: ???
952+
<b>Exercise</b>: Create the list page
948953
</h4>
949954

950955
<p>Open pages/list/list.component.ts and paste in this:</p>

src/chapters/chapter3.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,10 +525,16 @@ export class AppComponent {}
525525

526526
<div class="exercise-end"></div>
527527

528-
Let’s actually log the user in then, shall we?
528+
The main new concept here is the `@RouteConfig` decorator, which you use to provide a list of all routes that are present in your app. Currently you only have one route, which is why `@RouteConfig` contains a single entry.
529+
530+
> **TIP**: If you haven’t played with Angular 2 routing before, you can refer to [Angular’s tutorial on the topic](https://angular.io/docs/ts/latest/tutorial/toh-pt5.html) for some background.
531+
532+
The other new concept in this example is `<page-router-outlet>`, which is your app’s first directive. You can check out Angular’s docs for [details on what directives do](https://angular.io/docs/ts/latest/api/core/Directive-decorator.html), but the simplest way to think of them is as something that can affect the markup you put in your `template`—in this case `<page-router-outlet>`.
533+
534+
Angular 2 provides a `<router-outlet>` directive for web apps, and NativeScript extends that directive with its own `<page-router-outlet>` directive that handles the unique environment of iOS and Android apps. To see how it works lets add another page.
529535

530536
<h4 class="exercise-start">
531-
<b>Exercise</b>: ???
537+
<b>Exercise</b>: Create the list page
532538
</h4>
533539

534540
Open pages/list/list.component.ts and paste in this:

0 commit comments

Comments
 (0)