AngularJS when routing is enabled cannot resolve view parameter from Express render()

I use Hogan templating engine in my Node-Express-Anuglar app. Because I use Anguar within Hogan templates I've changed Hogan's delimeters:

app.js

app.locals.delimiters = '{% %}';
app.set('view engine', 'hjs');

Thus I can show view parameter like this (Angular goes as common):

index.hjs

<!DOCTYPE html>
<html data-ng-app="app">
<head>
    <title>{% title %}</title>
</head>
<body ng-controller="TestController">
    From Angular model: {{model.testProperty}}

I pass parameters in render function:

index.js in routes directory:

router.get('/', function(req, res, next) {
  res.render('index', { title: 'Example title' });
});

In this case everything works well so {% title %} resolves to Example title and {{model.testProperty}} resolves to proper value from my controller.

Problems occours when I add routing in Angular side:

module.config(['$routeProvider', '$locationProvider',
    function ($routeProvider, $locationProvider) {
        $locationProvider.html5Mode({
            enabled: true,
            requireBase: false
        });

        $routeProvider.
            when('/', {
                templateUrl: '../diary/diary.html',
                controller: 'TestController'
            }).
            when('/promoted', {
                templateUrl: '..diary/promoted-diary.html',
                controller: 'PromotedController'
            }).
            otherwise({
                redirectTo: '/'
            });         
    }]
);

because variable {% title %} is rendered as {% title %} (so it wasn't evaluted) . Whole Angular stuff eg. {{ model.testProperty }} works just like before, so it's properly resolved to value from controller.

I think you are missing a trick here. If you look into some of the popular MEAN seed projects like MEAN.io or MEAN.JS, Express is used as a REST engine which provides API for AngularJS in the front end rendering, routing, data binding.

So i suggest you to send JSON data from backend:

router.get('/', function(req, res, next) {
  res.json('index', { title: 'Example title' });
});

Use Angular ngResource to consume the data from your APIs and you got router anyways in front end which will handle the view authentication and authorization, displaying logic. AngularJS has got rich rendering and two way binding feature, try to use it. Let me know if you need more detailed answer.

Note: You can even do this with plain HTML, without using any template engine for same. For simple implementation, please look here