mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Fix unexpected error when following the tutorial (when going through it with stricter type checking enforced). While (+) converts a string to an integer, it does not account for the possibility that `this.route.snapshot.paramMap.get('id')` could return null (type: string | null). Since this null case is not a practical outcome, it is a matter of types; switching from (+) to the `Number` function eliminates this issue, making the tutorial more robust.
PR Close #41570
|
||
|---|---|---|
| .. | ||
| e2e/src | ||
| src | ||
| example-config.json | ||
| stackblitz.json | ||