diff --git a/aio/content/guide/routing-with-urlmatcher.md b/aio/content/guide/routing-with-urlmatcher.md index 39fcf49612..6951e16536 100644 --- a/aio/content/guide/routing-with-urlmatcher.md +++ b/aio/content/guide/routing-with-urlmatcher.md @@ -48,12 +48,12 @@ Using the Angular CLI, create a new application, _angular-custom-route-match_. I 1. In your code editor, locate the file, `profile.component.html` and replace the placeholder content with the following HTML. - + 1. In your code editor, locate the file, `app.component.html` and replace the placeholder content with the following HTML. - - + + ## Configure your routes for your application @@ -63,21 +63,21 @@ With your application framework in place, you next need to add routing capabilit 1. Add an `import` statement for Angular's `RouterModule` and `UrlMatcher`. - + 1. In the imports array, add a `RouterModule.forRoot([])` statement. - + 1. Define the custom route matcher by adding the following code to the `RouterModule.forRoot()` statement. - + This custom matcher is a function that performs the following tasks: * The matcher verifies that the array contains only one segment. * The matcher employs a regular expression to ensure that the format of the username is a match. -* If there is a match, the function returns the entire URL, defining a `username` route parameter as a substring of the path. +* If there is a match, the function returns the entire URL, defining a `username` route parameter as a substring of the path. * If there isn't a match, the function returns null and the router continues to look for other routes that match the URL.
@@ -94,19 +94,19 @@ With the custom matcher in place, you now need to subscribe to the route paramet 1. Add an `import` statement for Angular's `ActivatedRoute` and `ParamMap`. - + 1. Add an `import` statement for RxJS `map`. - + 1. Subscribe to the `username` route parameter. - + 1. Inject the `ActivatedRoute` into the component's constructor. - + ## Test your custom URL matcher