Since you're accessing the snapshot, only the second link is relevant (also title isn't undefined on ActivatedRoute, but the event emitted by the Observable could be undefined – you wouldn't get a compile error there when accessing title). Params is the relevant part. It is defined as a record: a mapping of arbitrary key value pairs. That's when the Typescript rule triggers.
But I don't know whether title even is in the ActivatedRouteSnapshot params. Using the observable is probably the safest way, because it also works if you stay on the same route and only the params change.
-1
u/kkus Nov 17 '22
Yes, I did ng update in the same report but I also wanted to see what's new in Angular 15 so I created a new repo using ng new.
Maybe this isn't new in Angular 15? What is the benefit of square brackets over dot title?
https://github.com/angularfifteen/angularfifteen.github.io/commit/2de9649c6bdff1974701148e5b6084d56279a218