I am currently building a website that uses NodeJS for the server, Express Handlebars(Just Handlebars but server side) , and hopefully AngularJS for some client side stuff.
AngularJS and Handlebars use the same syntax for templating
{{foo}}
This causes a problem where AngularJS code will be interpreted by Express Handlebars first, which will then throw an error because the data it is trying to pull only exists in Angular not Node.
Is there a way to get AngularJS and Express Handlebars to work together?
ng
helper in Express Handlebars.
Your first solution is possible, AngularJS allow to change the start/end symbols of text interpolation like this:
appModule.config(function($interpolateProvider) {
$interpolateProvider.startSymbol('{[{');
$interpolateProvider.endSymbol('}]}');
});
Then you could use it in your template:
<div>{[{message}]}</div>
Also see: $interpolateProvider documentation
Hope this helps.