上午有6个HTML文件中,我采用了棱角分明的js配置ngroute,每一个HTML文件,图像jQuery的滑块和我已经使用了节点快递网络服务器作为服务器的地方在3000端口运行,如果我启动我的服务器和我打开我的浏览器并加载本地主机:3000我能得到index.html文件及其内容,如果要前往其他菜单链接是无法获取的HTML内容文件,但它的加载预加载器而已,我发表我的HTML和角度的js代码下面请大家指正任何一点毛病角JS ngroute不工作的静态HTML文件
HTML
<div class="navbar-collapse pull-right nav-main-collapse collapse" ng-app="sam">
<nav class="nav-main">
<!--NOTE
For a regular link, remove "dropdown" class from LI tag and "dropdown-toggle" class from the href.
Direct Link Example:
<li> <a href="#">HOME</a> </li>
-->
<ul id="topMain" class="nav nav-pills nav-main">
<li class="active"><!-- HOME -->
<a href="#index"> Home </a> </li>
<li class="active"><!-- Instruction to Authors -->
<a href="#author"> Instructions to Authors </a> </li>
<li class="active"><!-- Manuscript Submission -->
<a href="#manuscript">Manuscript Submission </a> </li>
<li class="active"><!-- Contents -->
<a href="#contents"> Contents </a> </li>
<li class="active"><!-- Editorial Board -->
<a href="#editorial"> Editorial Policy </a> </li>
<li class="active"><!-- Contact Us -->
<a href="#contact"> Contact Us </a> </li>
</ul>
<div ng-view></div>
</nav>
</div>
周的script.js(角js文件)
var app = angular.module('sam', ['ngRoute']);
app.config(function ($routeProvider) {
$routeProvider.
when('/index', {
templateUrl: 'index.html'
}).
when('/author', {
templateUrl: 'author.html'
}).
when('/contact', {
templateUrl: 'contact.html'
}).
when('/contents', {
templateUrl: 'contents.html'
}).
when('/editorial', {
templateUrl: 'editorial.html'
}).
when('/manuscript', {
templateUrl: 'manuscript.html'
});
});
是的,我已经添加了#/到链接标记它只是加载预加载不仅没有内容 –