我的路线在我的localhost中完美运行。
我正在使用此示例,但示例中我的本地编号:http://plnkr.co/edit/AK9uYfpgTIHt9HUdHsjJ?p=preview
效果很好如果我点击链接:<li class="active"><a ui-sref="details" target="_blank">Details</a></li>
,页面将打开空白,没有内容
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.7/angular.min.js"></script>
<script src="//angular-ui.github.io/ui-router/release/angular-ui-router.js"></script>
HTML:
<ul class="nav nav-tabs">
<li class="active"><a ui-sref="details" target="_blank">Details</a></li>
<li><a ui-sref="users">users</a></li>
</ul>
<div class="tab-content">
<div id="details">
<div class="col-md-12">
<div ui-view></div>
</div>
</div>
</div>
角:
var app = angular.module('app', ["ui.router"])
app.config(function($stateProvider, $urlRouterProvider){
// For any unmatched url, send to /route1
$urlRouterProvider.otherwise("/details")
$stateProvider
.state('details', {
url: "/details",
templateUrl: "app/details.html"
})
.state('users', {
url: "/users",
templateUrl: "app/users.html"
})
})