i use ui-router for nested routing in angularjs, it works fine but there is a problem, when i refresh the page or enter the url manually and directly, i get an error: The requested URL /home/general was not found on this server. my app code is:
angular.module("app",["ui.router"])
.controller("appController",["$scope", function($scope){}])
.config(function($stateProvider, $urlRouterProvider,$locationProvider){
$stateProvider
.state('home', {
url: "/",
templateUrl: "/library/ngTemplates/home.html"
})
.state('home.general', {
url: "home/general",
templateUrl: "/library/ngTemplates/home-general.html"
})
.state('home.lifeStyle', {
url: "home/life-style",
templateUrl: "/library/ngTemplates/home-life-style.html"
})
.state('home.lifeStyle.sport', {
url: "/sport",
templateUrl: "/library/ngTemplates/home-life-style-sport.html"
})
.state('home.lifeStyle.economic', {
url: "/economic",
templateUrl: "/library/ngTemplates/home-life-style-economic.html"
});
$locationProvider.html5Mode(true);
});