Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Angular ui路由器既不加载模板也不加载控制器?_Javascript_Angularjs_Angular Ui Router - Fatal编程技术网

Javascript Angular ui路由器既不加载模板也不加载控制器?

Javascript Angular ui路由器既不加载模板也不加载控制器?,javascript,angularjs,angular-ui-router,Javascript,Angularjs,Angular Ui Router,我使用ui路由器在页面之间移动,无需重新加载 下面是我的一个状态: $locationProvider.html5Mode({enabled: true, requireBase: false}); $stateProvider .state('aboutBook', { url: '/book/about/:bookId', templateUrl: '/views/books/about-book.tpl.html', controller: 'AboutBookCtrl' }

我使用
ui路由器
在页面之间移动,无需重新加载

下面是我的一个
状态

$locationProvider.html5Mode({enabled: true, requireBase: false});

$stateProvider
.state('aboutBook', {
  url: '/book/about/:bookId',
  templateUrl: '/views/books/about-book.tpl.html',
  controller: 'AboutBookCtrl'
})
在我的
index.php
文件中有
ui视图
div

<div ui-view></div>

更新:
$stateChangeStart
$stateChangeSuccessuccess
事件也不会触发。

您是否检查了控制台错误?是的,我检查了控制台错误:-)。你提供的JSFIDLE或plunk没有错误扫描吗?没有,因为它可以在小型演示应用程序中工作,但是它在我的应用程序中不工作,问题是“什么会导致这种行为?”。你有其他可能干扰这种行为的路由吗/book/about/id您是否检查了控制台中的错误?是的,我检查了控制台中的错误:-)。你提供的JSFIDLE或plunk没有错误扫描吗?没有,因为它可以在小型演示应用程序中工作,但是它在我的应用程序中不工作,问题是“什么会导致这种行为?”。你有其他可能干扰这种行为的路由吗/书籍/关于/身份证
<div ng-include="'/views/books/about-book.tpl.html'"></div>