上午有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'
});
});
是的,我已經添加了#/到鏈接標記它只是加載預加載不僅沒有內容 –