AngularJs ui路由器有错误:http 404
我有一个使用angularJs分配控制器的问题。以下是我所拥有的:AngularJs ui路由器有错误:http 404,angularjs,Angularjs,我有一个使用angularJs分配控制器的问题。以下是我所拥有的: .config(function($stateProvider, $urlRouterProvider, $ocLazyLoadProvider, $locationProvider) { $stateProvider .state('core', { abstract: true, template: '<ui-view ></u
.config(function($stateProvider, $urlRouterProvider, $ocLazyLoadProvider, $locationProvider) {
$stateProvider
.state('core', {
abstract: true,
template: '<ui-view ></ui-view>',
cache: 'false',
controller: 'CoreController as core',
data: {
AuthRequired: true
}
});
$locationProvider.html5Mode(true);
$ocLazyLoadProvider.config({events: true});
})
.config(函数($stateProvider、$urlRouterProvider、$ocLazyLoadProvider、$locationProvider){
$stateProvider
.国家(“核心”{
摘要:没错,
模板:“”,
缓存:“false”,
控制器:“CoreController作为核心”,
数据:{
AuthRequired:true
}
});
$locationProvider.html5Mode(true);
$ocLazyLoadProvider.config({events:true});
})
和我的html:
<base href="/" />
网址:
但是,当enI在控制台上接收到错误时:
HTTP 404;未找到 你在哪里说我想去州
core
?将url更改为并提供url:'/core'
属性,或者在应用程序模块开始运行时使用$state.go('core')
。我知道你的意思。并且有一些变化:“.state('workbench.index',{url:'/workbench',}..”;“#”消失了,但错误仍然会发生。请不要理会我的蹩脚英语。