From 319da894be7c44d8b905bc14e3a0810401391108 Mon Sep 17 00:00:00 2001 From: Alan Cohen Date: Sat, 10 Apr 2021 21:26:09 -0400 Subject: [PATCH] docs: change ActivatedRouteStub code sample to work with strictNullChecks on (#41559) convertToParamMap() does not accept undefined. Fix code sample so it can be used in strict mode without requiring changes. PR Close #41559 --- .../examples/testing/src/testing/activated-route-stub.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aio/content/examples/testing/src/testing/activated-route-stub.ts b/aio/content/examples/testing/src/testing/activated-route-stub.ts index 3303f8d58c..59fec15af7 100644 --- a/aio/content/examples/testing/src/testing/activated-route-stub.ts +++ b/aio/content/examples/testing/src/testing/activated-route-stub.ts @@ -21,8 +21,8 @@ export class ActivatedRouteStub { /** The mock paramMap observable */ readonly paramMap = this.subject.asObservable(); - /** Set the paramMap observables's next value */ - setParamMap(params?: Params) { + /** Set the paramMap observable's next value */ + setParamMap(params: Params = {}) { this.subject.next(convertToParamMap(params)); } }