Repository navigation
Teach routing with tag pages - #38
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seventh lesson in my Angular guide: routing. The feature slice is a page for every tag.
What shipped
Tag pages.
/thoughts/tag/<tag>is prerendered for every tag, with its own title and canonical URL, and every tag pill links to it./thoughts/tag/angular-guideis the reading list for this series. Prerendered routes went from 27 to 74.It's a path param, not
?tag=. Prerendering writes one file per path, so a query-param page would be served the unfiltered list and then change under the reader during hydration.Cards are links. Thoughts list cards were
div role="button"s callingrouter.navigate(). Now the title is a realrouterLink, and a stretched::afterkeeps the whole card clickable. That is also what lets the tag pills be links, because a link can't sit inside a button.Wildcard route. A
**route sits last in the table and redirects to the desktop. A mistyped URL used to fail the first navigation withNG04002.Route input binding. The reader takes
:slugas an input viawithComponentInputBinding()instead oftoSignal(route.paramMap). ItsActivatedRouteand RxJS imports are gone.Lesson 07: routing (
/thoughts/angular-07-routing)getPrerenderParamsUrlSerializerand matches it against this site's real route table. A checkbox moves the wildcard to the front to show first-match-wins.Version and changelog. 1.4.6, with a matching changelog entry.
Commits
Verification
NG04002: Cannot match any routes. URL Segment: 'no-such-page'thoughts/tag/angular-guideNG0303for the missingtaginputapp.routes.spec.tsdrives the real route table with the realappConfigthroughRouterTestingHarness.ng test: 57 files, 406 tests, exit 0. They include a new axe check on the list. Axe also caught arole="status"on a<dd>in the lesson demo, which I moved to a wrapper.tsc --noEmitconfigs are clean.thoughts/tag/angular-guide/index.htmlhas the title "Thoughts tagged angular-guide", hrefs to all seven lessons, and a canonical of/thoughts/tag/angular-guide.TO-DOs for this PR
angular-guidetag page, and the lesson 07 playground, light and dark. Chromium couldn't launch in the environment I built this in.