0

I have two different Angular Apps and one App is redirecting to the other App using a hyperlink to a specific route. However, the system is throwing a Whitelabel Error Page. The empty path has no issue.

I used the default HTML 5 location strategy for the routing.

first app: "http://www.app1.com/" second app: "http://www.app2.com/"

the first app redirects to the second app thru: window.location.href = "http://www.app2.com/some-path";

This is my sample route in the second app:

{
    path: 'some-path',
    component: SomeComponent,

  },
{
    path: '',
    component: SomeEmptyComponent,

  }
3
  • Are apps deployed on different locations? How second app routing look like? How hyperlink look like? Commented Aug 16, 2019 at 13:41
  • @AkifHadziabdic yes, they are deployed in different locations. The calling application uses this: window.location.href = "app2.com/some-path" ; Commented Aug 16, 2019 at 14:17
  • Can you explain how did you deploy apps? Do you have some auth system on apps like spring security on backend side? Can you share you a html tag? Can you open same url if you put url directly in browser? Commented Aug 17, 2019 at 20:30

2 Answers 2

2

Use href for any other application

<a class=" href=""></a>

you can use relative path e.g

 <a class=" href="#/list?Id=2"></a>
Sign up to request clarification or add additional context in comments.

Comments

1

Internal link (should match your routing config):

<a [routerLink]="['/some-path']" [queryParams]="{debug: true}">Some path</a>
<a [routerLink]="['/']" [queryParams]="{debug: true}">Home</a>

External link (should contain absolute path or relative which link other app):

<a href="www.facebook.com/yourpage">Facebook</a>

Comments

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.