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

I think we do not need endsWithlogic in router. #5

Open
vugar005 opened this issue Jan 18, 2022 · 0 comments
Open

I think we do not need endsWithlogic in router. #5

vugar005 opened this issue Jan 18, 2022 · 0 comments

Comments

@vugar005
Copy link

Hi, thanks for repo. After some playing with project I realized we do not need endsWithlogic in router
Problem:
Because it is not going to work with params. For example, we can not march a/:id with { matcher: endsWith('a'), component: AComponent}.
Solution:
Instead of endsWith

    RouterModule.forRoot([
     { matcher: endsWith('a'), component: AComponent },
     { matcher: endsWith('b'), component: BComponent },
   ], { relativeLinkResolution: 'legacy' })

We can just use like below:

  RouterModule.forRoot([
     {
       path: 'mfe2',
       children: [
         { path: '', redirectTo: 'a', pathMatch: 'full' },
         { path: 'a', component: AComponent },
         { path: 'b', component: BComponent },
       ],
     },
], { relativeLinkResolution: 'legacy' })

I made sample PR which includes those small changes + feature with router params.

https://github.com/manfredsteyer/multi-framework-micro-frontend/pull/4/files

But nevertheless I think I can miss something, @manfredsteyer could you tell please why you chose endsWith?
Thanks in advance.

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

No branches or pull requests

1 participant