0

I have the following URL: localhost.com:1234/?param1=abc&param2=def

Route.config = [
    { path: 'first', component: 'firstComponent' },
    { path: 'second', component: 'secondComponent' }
]

While app initializes the URL gets replaced to localhost.com:1234/#/first.

How I can prevent this, so that my redirect url will be localhost.com:1234/?param1=abc&param2=def#/first?

Antti29
  • 2,953
  • 12
  • 34
  • 36
Asit
  • 63
  • 6

1 Answers1

0

You can use a redirect when none of the previous router matched.

{ path: '**', redirectTo: 'yourCustomComponent'}
Marco Castano
  • 1,114
  • 1
  • 10
  • 25