angular.module('myApp', []).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/', {templateUrl: 'partials/some.jade', controller: myAppController}).
otherwise({redirectTo: '/login'
});
}]);
上面的代码加载了some.jade
部分,但是像html
这样对待它h1 try me
应该被呈现为<h1> try me </h1>
简单地呈现为纯文本h1 try me
编辑:后端
app.configure(function(){
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.static(__dirname + '/public'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
});
app.get('/', function(req,res){
//res.send('hi');
res.render('login', { title: 'Express' });
});