Problems with angular route 2 and laravel 5

0

I have a system in laravel 5.3, and I'm putting the angular 2 to take care of the front end. I have several modules, ex: companies. The route / companies will lead to the listing of companies getting like this: localhost: 8000 / companies ... But there is however, in that view, I load the app.component from angular2 to do a routing (to make a corporate single page), but when it loads the route from angular 2, it adds the link in angular getting only localhost: 8000 , and gives some errors, like:

  

EXCEPTION: Uncaught (in promise): Error: Can not match any routes:   'companies'

But even if this error appears, everything works, but the problem is that it adds the laravel's Url and is practically at the root of the angular ... I thought of something like: that I have to load the angular already with the / corporations (as root), but how to do?

    
asked by anonymous 07.11.2016 / 23:51

1 answer

0

I have done it for anyone who has doubts. I did 2 steps: - > in the index.php I put

 <base href="/empresas"> 

because before it was only

<base href="/"> 

So he would return the address to localhost: 8000. And regarding the error, it was necessary to specify the root route, which in this case is empty "". Thank you for your attention.

    
08.11.2016 / 20:17