Routing problem after final build in angular 2

0

After generating a final build in angular 2 ng build --prod I was able to put it on any server (nginx / tomcat / others ...) normally, the problem happens that the routing does not work using the <router-outlet> tag and the app.routing.ts file to configure the routes. Has anyone gone through this?

    
asked by anonymous 13.03.2017 / 19:07

2 answers

0

Problem solved with routerLink at the link below

If the content is an additional module you should also import the routing component into this new module .

    

10.04.2017 / 22:46
0

Simple if you have to use a folder:

ng build --base-href / myUrl / or ng build --bh / myUrl /

For example I have to by the site in a directive called site2 so ng build --bh / site2 /

More Information link

    
15.03.2017 / 10:39