I am working on an E-Commerce WebApp. In which I am using Laravel for the backend and Angularjs for the front end. But the problem it when I click on specifc navigation item it will work fine but when I reload the page,It will go for laravel routing and all me css, js, images etc. will not loaded properly.
Laravel Code :
Route::get('/', function () {
return view('index');
});
Route::get('/dashboard', function () {
return view('dashboard');
});
Route::get('/products', function () {
return view('products');
});
Angularjs Routing:
var ecommerceApp=angular.module('ecommerceApp',['ngAnimate', 'ngSanitize', 'ui.bootstrap','ngRoute']);
ecommerceApp.config(['$routeProvider','$locationProvider',function($routeProvider,$locationProvider) {
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
$routeProvider
.when("/a", {
templateUrl : "dashboard",
controller: 'ecommerce'
})
.when("/products", {
templateUrl : "products",
controller: 'ecommerce'
})
}]);
I am stuck in this problem plz help me. Thanks in advance