fix(docs-infra): remove `routerLink` from `top-bar` (#35951)

Closes #35947

PR Close #35951
This commit is contained in:
Sonu Kapoor 2020-03-09 05:34:41 -04:00 committed by Andrew Kushnir
parent db74f2074b
commit 6b4c5289b3
3 changed files with 14 additions and 9 deletions

View File

@ -2,4 +2,4 @@
<h1>My Store</h1> <h1>My Store</h1>
</a> </a>
<a [routerLink]="['/cart']" class="button fancy-button"><i class="material-icons">shopping_cart</i>Checkout</a> <a class="button fancy-button"><i class="material-icons">shopping_cart</i>Checkout</a>

View File

@ -2,6 +2,8 @@
<h1>My Store</h1> <h1>My Store</h1>
</a> </a>
<a [routerLink]="['/cart']" class="button fancy-button"> <!-- #docregion cart-route -->
<a routerLink="/cart" class="button fancy-button">
<i class="material-icons">shopping_cart</i>Checkout <i class="material-icons">shopping_cart</i>Checkout
</a> </a>
<!-- #enddocregion cart-route -->

View File

@ -141,19 +141,22 @@ Create the cart page in two steps:
<code-example header="src/app/app.module.ts" path="getting-started/src/app/app.module.ts" region="cart-route"> <code-example header="src/app/app.module.ts" path="getting-started/src/app/app.module.ts" region="cart-route">
</code-example> </code-example>
1. Update the "Checkout" button so that it routes to the `/cart` url.
Open `top-bar.component.html` and add a `routerLink` directive pointing to `/cart`.
<code-example
header="src/app/top-bar/top-bar.component.html"
path="getting-started/src/app/top-bar/top-bar.component.html"
region="cart-route">
</code-example>
1. To see the new cart component, click the "Checkout" button. You can see the "cart works!" default text, and the URL has the pattern `https://getting-started.stackblitz.io/cart`, where `getting-started.stackblitz.io` may be different for your StackBlitz project. 1. To see the new cart component, click the "Checkout" button. You can see the "cart works!" default text, and the URL has the pattern `https://getting-started.stackblitz.io/cart`, where `getting-started.stackblitz.io` may be different for your StackBlitz project.
<div class="alert is-helpful">
The starter code for the "Checkout" button already includes a `routerLink` for `/cart` the top-bar component.
</div>
<div class="lightbox"> <div class="lightbox">
<img src='generated/images/guide/start/cart-works.png' alt="Display cart page before customizing"> <img src='generated/images/guide/start/cart-works.png' alt="Display cart page before customizing">
</div> </div>
### Display the cart items ### Display the cart items
You can use services to share data across components: You can use services to share data across components: