user2517610
user2517610

Reputation: 275

Laravel route not found with angularjs route

I am trying to concatenate Laravel route and angular route in href like this:

<a  href="./home/#/orders">Orders</a>

It shows correct url when I hover the link:

localhost/myproject/home/#/orders

But when I click on the link it redirects me to the following:

localhost/home/#/orders

It removes the project name from the link.

Here is laravel route:

Route::group(['namespace' => 'Frontend'], function(){
        Route::get('/home', 'IndexController@home1');
});

And angular route:

.when('/orders', {
      templateUrl: './resources/views/Order/orders.html',
      controller: 'OrderController'
})

What am I doing wrong?

Please guide me.

Thanks.

Upvotes: 0

Views: 111

Answers (2)

user2517610
user2517610

Reputation: 275

I resolved it by removing '/' after home like this:

href="./home#/orders"

Upvotes: 0

jignesh patel
jignesh patel

Reputation: 131

try this

<a  href="{{URL::to('home/#/orders')}}">Orders</a>

URL::to genreat the root url like http://localhost/yourproject/

Upvotes: 2

Related Questions