0

enter image description here How do I navigate from new-contract component to customer-details component?

I tried following on the new-contract component but it keeps navigating to 404.

this.back_url = '/customer/customer-details 
this.router.navigate([this.back_url]);
1
  • 2
    It depends on the routing module you defined Commented Feb 22, 2019 at 9:02

3 Answers 3

1

Try this -

this.router.navigateByUrl(/customer/customer-details);
Sign up to request clarification or add additional context in comments.

Comments

0

Use router to navigate between pages. Import the component in the routing module and do like this

this.router.navigate('customer/customer-details')

Comments

0

Since you are navigating with url string, you must use Router.navigateByUrl function.

  this.router.navigateByUrl('/customer/customer-details');

1 Comment

No, There is no point of must here you could use navigate alone as well, but syntax here was wrong

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.