我正在使用atom ide来运行以下角度代码
<!DOCTYPE html>
<html ng-app="home">
<head>
<title></title>
<meta charset="utf-8" />
<script src =
"https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js">
</script>
<script src ="/controller/sample.js"></script>
<link
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel="stylesheet">
</head>
<body class="container" ng-controller="designController">
<br/>
<br />
<br />
<div class="row" style="background-color:purple;">
<font color="white">ellucian University</font>
</div>
<br/>
<br/>
</body>
</html>
我有另一个控制器sample.js
angular.module('home',[]).controller('designController',function($scope){
$scope.message = "hii";
});
我有另一个app.js文件来运行服务器
var express = require('express');
var path = require("path");
var app= express();
app.get('/',function(req,res){
res.sendFile(path.join(__dirname+'/index.html'));
});
app.listen(3000);
console.log('you are listening to a port 3000');
每当我运行我的app.js文件时,我得到一个index.html页面,但angular不在index.html文件中工作我是nodejs的新手,所以请帮帮我。提前致谢