Hi,

i have two webserver.
The first webserver (http://localhost:3000/) runs with angular2 and 
contains all components and angular files.
The second webserver (http://localhost:4000/) contains a multipage website. 

I want to include the angular components inside the multipage. 
The use of iframe is unfortunately excluded.

This works fine if i dont use the angular routing.
But if i try to use angular routing i get the following error:

ERROR Error: Uncaught (in promise): SecurityError: Failed to execute 
> 'replaceState' on 'History': A history state object with URL 
> 'http://localhost:3000/' cannot be created in a document with origin 
> 'http://localhost:4000/' and URL 'http://localhost:4000/test.html'.


 The file http://localhost:4000/test.html looks like this:
<html> <head> <base href="http://localhost:3000/";>
<script>
System.import('app').catch(function(err){ console.error(err); });
</script> </head> <body> <div> <app-component></app-component> </div> <br> <
script type="text/javascript" src=
"http://localhost:3000/node_modules/core-js/client/shim.min.js";></script> <
script type="text/javascript" src=
"http://localhost:3000/node_modules/zone.js/dist/zone.js";></script> <script 
type="text/javascript" src=
"http://localhost:3000/node_modules/systemjs/dist/system.src.js";></script> <
script type="text/javascript" src="http://localhost:3000/systemjs.config.js";
></script> </body> </html>

The base path base href="http://localhost:3000/ is needet to find the file 
main.js.

If i leave it out i get the error:

>  zone.js:1990 GET http://localhost:4000/'main.js 404 (Not Found)

 
The file main.js is on the server http://localhost:3000/ like the other 
angular files.

I would be glad if you have a idea to solve this problem.

Best regards
Felix

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to