I am just trying out node js and angular js. here is my node code:
var http = require('http');
var fs = require('fs');
var sys = require('sys');
http.createServer(function(req, res){
fs.readFile('angularjsex.html',function (err, data){
res.writeHead(200, {'Content-Type': 'text/html','Content-Length':data.length});
res.write(data);
res.end();
});
}).listen(8000);
The angularjsex.html file:
<html ng-app>
<head>
<script type="text/javascript" src="angular.js"></script>
</head>
<body>
<div>
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a name here">
<hr>
<h1>Hello {{yourName}}!</h1>
</div>
</body>
</html>
The angular js just does not work. Am i missing something?