Repository navigation
Angular 03: templates and binding - #34
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.
Third lesson in my Angular guide. Writing it turned up two real keyboard bugs and a date-formatting trap, and all three are fixed here.
What shipped
Fix: ⌃⌥Space never opened Spotlight.
App.onKeydowncalledshortcuts.handleKeydown(event)twice per keydown.host: { '(document:keydown)': … }instead of@HostListener.Fix: ⌘Space was swallowed. A leftover
preventDefault()that the 1.3.4 remap meant to remove is gone. A spec pins it.Readable dates. Cards and the reader show "Jun 15, 2026" in a
<time datetime>, formatted in UTC so a bareYYYY-MM-DDdoesn't shift a day west of UTC. The detail is in the bundle section below.Reading time. A pure
readingTimepipe on prose thoughts.Lesson 03: templates and binding (
/thoughts/angular-03-templates)@for/@empty/@let/@switchon a removable tag list.Version and changelog. 1.4.2, with a matching changelog entry.
The bundle detour
DatePipewas the first version, and the production build put the initial bundle up 13 kB (375.71 → 389.07 kB):@angular/commonis one module the app already loads eagerly.DatePipe's locale code landed in the initial chunk, even though both thought views are lazy.The fix is a five-line
utcDatepipe overIntl.DateTimeFormat. It renders the same output and brings the initial bundle back to 377.25 kB. That story is now an expert callout in the lesson.Commits
Verification
spotlightOpenstayedfalseafter one ⌃⌥Space, ⌘Space wasdefaultPrevented, and dates rendered as2026-06-15.ng test: 47 files, 341 tests, exit 0. Lint and bothtsc --noEmitconfigs are clean./thoughts/signalsshowsJun 15, 2026 · 1 min read.TO-DOs for this PR