Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router state is not serializable when custom title Resolver is used #3495

Closed
2 tasks
markostanimirovic opened this issue Jul 17, 2022 · 0 comments · Fixed by #3593
Closed
2 tasks

Router state is not serializable when custom title Resolver is used #3495

markostanimirovic opened this issue Jul 17, 2022 · 0 comments · Fixed by #3593

Comments

@markostanimirovic
Copy link
Member

Minimal reproduction of the bug/regression with instructions

If a route uses custom title Resolver:

@Injectable({
  providedIn: 'root',
})
class TestResolver implements Resolve<string> {
  resolve(): string {
    return 'Test Title';
  }
}

const routes: Routes = [
  {
    path: 'test',
    component: TestComponent,
    title: TestResolver,
  },
];

The router state won't be serializable because the value of routeConfig.title will be TestResolver class.

Minimal reproduction of the bug/regression with instructions

The value of the routeConfig.title property should be resolved title.

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)

NgRx ^14.0.0
Angular ^14.0.0

Other information

When resolved, the route title will be part of the route.data object, but its key is a symbol (Symbol('RouteTitle')) that is not part of the public API.

I would be willing to submit a PR to fix this issue

  • Yes
  • No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant