javascript - Using Express Handlebars and Angular JS -
background
i building website uses nodejs server, express handlebars(just handlebars server side) , , angularjs client side stuff.
the problem
angularjs , handlebars use same syntax templating
{{foo}}
causes problem angularjs code interpreted express handlebars first, throw error because data trying pull exists in angular not node.
the question
is there way angularjs , express handlebars work together?
possible solutions
- change syntax of angularjs
- i looking @ backbonejs , looks possible change syntax. there possibly similar angularjs.
- create
ng
helper in express handlebars.- it return un-parsed content. couldn't figure out how this.
your first solution possible, angularjs allow change start/end symbols of text interpolation this:
appmodule.config(function($interpolateprovider) { $interpolateprovider.startsymbol('{[{'); $interpolateprovider.endsymbol('}]}'); });
then use in template:
<div>{[{message}]}</div>
also see: $interpolateprovider documentation
hope helps.
Comments
Post a Comment