RE: Liferay SPA - how to resolve conflict with same hostname and another applic

Jamie Sammons, modified 2 Years ago. New Member Posts: 3 Join Date: 2/17/19 Recent Posts

Hi All,

We are using Liferay portal with SPA setting enabled. On the same hostname we have another angular application.

When a link of that application is added in href then due to SPA only body is replaced and the page appears distorted as its a angular website page and css & js has not loaded.

For eg. we have a hostname - https://hostname.com used for Liferay portal. And some urls  ike https://hostname.com/angular, https://hostname.com/angular1, https://hostname.com/angular2 are poiting to anugular website.

So when we are using above links of angular website in a page of https://hostname.com(Liferay portal) the page does not render with proper css and js due to SPA. We have to add data-senna-off=true in href to load the page correctly.

Is there any way to load pages correctly as the list of angular website urls are not finite and we need a soclution that can work without data-senna-off parameter.

Thanks

thumbnail
Jamie Sammons, modified 2 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

You can add the Angular App as "Remote Application" (assuming 7.4), and just embed it in the portal's page, rather than linking out to the app.

Not really what I'd recommend, but SPA can be disabled globally as well.

Or you might be able to just add yet another host and rather load your applications from there, if you don't want to embed them in the page.

Jamie Sammons, modified 2 Years ago. New Member Posts: 3 Join Date: 2/17/19 Recent Posts

Thanks Olaf, for the time being we have put a script on page to check urls with specific contexts and add data-senna-off true to it.