Skip to content

Commit

Permalink
feat(router): add thisArg for routerOutlet
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd committed Apr 19, 2023
1 parent c04f609 commit 2bfd1f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/router/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const documentBaseUrl = document.querySelector('base')?.href || '/';
* routerOutlet(routeConfig);
* ```
*/
export const routerOutlet = (routesConfig: RoutesConfig): unknown => {
export const routerOutlet = (routesConfig: RoutesConfig, thisArg: unknown = null): unknown => {
logger.logMethodArgs?.('routerOutlet', {routesConfig});

const routeContext = routeContextConsumer.getValue();
Expand All @@ -64,7 +64,7 @@ export const routerOutlet = (routesConfig: RoutesConfig): unknown => {

try {
if (typeof render === 'function') {
return render(routeContext);
return render.call(thisArg, routeContext);
}
// else
if (routeId === '') {
Expand Down

0 comments on commit 2bfd1f5

Please sign in to comment.