朋友们,我是这个意思是堆栈应用程序的新手。我想插入一个 我的应用程序中的徽标我使用index.html文件中的fallowing代码
<html ng-app="myapp">
<head>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script data-require="angular.js@1.2.21" data-semver="1.2.21" src="https://code.angularjs.org/1.2.21/angular.js"></script>
<!-- <script src="https://d3js.org/d3.v4.min.js"></script>
<script src="smart-table.debug.js"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.1/angular-ui-router.min.js"></script><!-- ui router cdn -->
<script src="controller.js"></script>
<script src="config.js"></script>
</head>
<body ng-controller="finance" class="container">
<div id="banner">
<div id="page-header">
<div class="container">
<img id="logo-main" src="../images/saf-logo.png" width="500" height="75" alt="Logo Thing main logo" class="image-responsive">
</div>
</div>
</div>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
</div>
<ul class="nav navbar-nav">
<li><a ui-sref="add-client">Register Form</a></li>
<li><a ui-sref="client-view">Clients View</a></li>
<!-- <li><a ui-sref="chart">Chart</a></li> -->
</ul>
</div>
</nav>
<div class="container">
<!-- THIS IS WHERE WE WILL INJECT OUR CONTENT ============================== -->
<div ui-view> </div>
</div>
</body>
</html>
但是当我运行时,它显示了控制台中的延迟错误 应用。获取http://localhost:8000/images/saf-logo.png 404(不是 发现) 我使用angularjs expressjs mongodb和node.js
controler.js
var app = angular.module('myapp', ['ui.router']);
console.log("controller out side");
app.controller('finance',['$scope',function($scope){
// console.log("inside controller");
}])
快递代码。
var express=require('express');
var app=express();
var bodyParser=require('body-parser');
app.use(bodyParser.json());
app.use(express.static('public'));
app.use(bodyParser.urlencoded({extended: true}))
console.log("welcome to finance app");
app.listen(8000);
package.json文件
{
"name": "finance",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"angular": "^1.5.10",
"angular-animate": "^1.5.10",
"angular-aria": "^1.5.10",
"body-parser": "^1.15.2",
"http-server": "^0.9.0",
"mongoose": "^4.7.5",
"angular-material": "^1.1.1",
"nodemon": "^1.11.0",
"express": "^4.14.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"index":"nodemon src/index.js"
},
"author": "",
"license": "ISC"
}