0

I was working on router in angular 2. My URL has the following parameters for example: www.hi.com?name=foo,bar

I want to pass the parameter data to my route as I want to filter some data based on 'name'.

<ul>
    <li><a [routerLink]="['/NewPage']">NewPage</a></li>
    <li><a [routerLink]="['/EmployeeData']">Security Dashboard</a></li>
</ul>
<div>
    <router-outlet></router-outlet>
</div>

I want the parameter to be used in the route as /EmployeeData?name=foo,bar

How can I achieve this ?

Thanks in Advance

1 Answer 1

0

I think this is what you need:

<a [routerLink]="['/EmployeeData']" [queryParams]="{name:foo}">Security Dashboard</a></li>
Sign up to request clarification or add additional context in comments.

1 Comment

will try this . Thank You :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.