Angular js ngroute不适用于静态HTML文件

Angular js ngroute不适用于静态HTML文件,html,angularjs,node.js,ngroute,angularjs-ng-route,Html,Angularjs,Node.js,Ngroute,Angularjs Ng Route,我有6个html文件,其中我使用angular js配置ngroute,每个html文件都有图像jquery滑块,我使用node express web server作为服务器,如果我启动服务器并打开浏览器并加载localhost,它将在3000端口上运行:3000如果导航到其他菜单链接,我可以获取index.html文件及其内容我无法获取该html文件的内容,但其仅加载预加载程序,我在下面发布我的HTML和angular js代码,请纠正我的任何错误 HTML 你应该链接到#/author而不

我有6个html文件,其中我使用angular js配置ngroute,每个html文件都有图像jquery滑块,我使用node express web server作为服务器,如果我启动服务器并打开浏览器并加载localhost,它将在3000端口上运行:3000如果导航到其他菜单链接,我可以获取index.html文件及其内容我无法获取该html文件的内容,但其仅加载预加载程序,我在下面发布我的HTML和angular js代码,请纠正我的任何错误

HTML


你应该链接到
#/author
而不是
#author
请确保你在index.html中包含了Angle route.js

<script src="bower_components/angular-route/angular-route.js"></script>


你可以按照给定的链接来确保你的代码

是的,我已经在链接标签中添加了#/,它只是加载了预加载程序,而不是内容。实际上我是从cdn获得的。请将你的路由器代码放在这里,或者你可以通过添加node express codevar express=require('express')来更新你的问题;var-app=express();var path=require('path');应用程序使用(express.static(u dirname+'/');app.get(/^\/((?:[^\/]+\/?)+)\//,函数(req,res){res.send(req.params[0].split('/');});listen(3000,function(){console.log(“它在端口3000上启动”);});
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'
      });

}); 
<script src="bower_components/angular-route/angular-route.js"></script>