我已经尝试了为同一个问题提供的所有解决方案。但错误仍然显示。 下面的代码来自index.html,其中所有依赖项都已链接。已检查所有文件的路径。
<base href="/">
<!--<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:200,400,500,700,400italic">-->
<link rel='stylesheet prefetch' href='https://cdn.gitcdn.link/cdn/angular/bower-material/v1.1.4/angular-material.css'>
<link rel='stylesheet prefetch' href='https://material.angularjs.org/1.1.4/docs.css'>
<!--for icons-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://rawgit.com/daniel-nagy/md-data-table/master/dist/md-data-table.css">
<!--for general-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.js "></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-animate.min.js "></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-aria.min.js "></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-messages.min.js "></script>
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.1/angular-material.js "></script>
<script src="https://npmcdn.com/angular-ui-router@1.0.0-alpha.4/release/angular-ui-router.js"></script>
<!--for md-data-table -->
<script src="https://rawgit.com/daniel-nagy/md-data-table/master/dist/md-data-table.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.1/angular-material.min.css">
<!--for home-->
<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'></script>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-resource.min.js'></script>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-route.min.js'></script>
<!---->
<link rel='stylesheet prefetch' href='https://cdn.gitcdn.link/cdn/angular/bower-material/v1.1.4/angular-material.css'>
<link rel='stylesheet prefetch' href='https://material.angularjs.org/1.1.4/docs.css'>
<!--for data table-->
<link rel="stylesheet" href="https://rawgit.com/daniel-nagy/md-data-table/master/dist/md-data-table.css">
<script src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/t-114/svg-assets-cache.js'>
</script>
<!-- components and services -->
<script src="/client/app.js"></script>
<script src="/app.js"></script>
<script src="/components/login.js"></script>
<script src="/components/signup.js"></script>
<script src="/components/signup2.js"></script>
<script src="/components/page2.js"></script>
<script src="/components/page3.js"></script>
<script src="/components/page4.js"></script>
<script src="/components/page5.js"></script>
<script src="/components/page6.js"></script>
<script src="/components/page7.js"></script>
<script src="/components/page8.js"></script>
<script src="/components/page9.js"></script>
<script src="/components/dashboard.js"></script>
<script src="/client/js/loginService.js"></script>
<script type="text/javascript" src="/client/js/lf-ng-md-file-input.js"></script>
<script src="/components/doctor_restricted.js"></script>
<!-- Visualizer and url -->
<link rel="stylesheet" href="styles.css">
<!--for input file type-->
<link rel="stylesheet" href="/client/css/lf-ng-md-file-input.min.css">
<script src="https://npmcdn.com/d3@3"></script>
<script src="https://npmcdn.com/ui-router-visualizer@1"></script>
显示错误的js代码 - loginService:
(function () {
'use strict';
angular
.module('app',[])
.factory('loginService', Service);
function Service($http,$state,$window, $log) {
var service = {};
service.demo = function(){
console.log('hello from service');
};
return service;
}
})();
app.js
const express = require('express')
const app = express()
const mongoose = require('mongoose');
const bodyParser = require('body-parser');
const expressJwt = require('express-jwt');
const path = require('path')
const cred = require('./server/config/cred');
// Basic usage
mongoose.connect('mongodb://localhost/orola');
console.log(cred.jwtSecret);
app.use('/secure', expressJwt({secret: cred.jwtSecret}));
app.use(bodyParser.json());
app.use(express.static(__dirname + '/client'));
require('./server/routes/doctor')(app);
require('./server/routes/user')(app);
app.get('*', function(req, res) {
res.sendFile(path.resolve('./client/index.html'));
});
app.listen(3003, function () {
console.log('Example app listening on port 3000!')
})