HoganJs和AngularJs用的NodeJS [英] HoganJs and AngularJs with NodeJs

查看:364
本文介绍了HoganJs和AngularJs用的NodeJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试使用具有的NodeJS为HoganJs服务器端模板。然而,我们也想用AngularJs为我们的客户端的需求。

We are trying to use NodeJs with HoganJs for server side templating. However we are also wanting to use AngularJs for our client side needs.

的问题是,既HoganJs和AngularJs用{{和}}完整填充其编译器的需求。正因为如此霍根剔除掉,如果在所有有一个角的{{,因为这样霍根作品。

The problem is that both HoganJs and AngularJs use "{{" and "}}" to full fill their compiler needs. Because of this Hogan strips out if at all there is a angular's "{{", because of the way hogan works.

我的问题是有没有一个现成的解决方案,可以让我同时使用角和Hogan一起,而不会相互冲突。

My question is is there a out of the box solution that allows me to use both Angular and Hogan together, without clashing with each other.

如果没有,有没有人知道是什么/在哪里/如何调整这些中的一个,使他们彼此相爱,并优雅地工作。

If not, does anyone knows what/where/how to tweak one of these to make them love each other and work gracefully.

在此先感谢...

推荐答案

与尝试

Hogan.compile(text, {delimiters: '<% %>'});

这样你就可以改变定界符霍根
通过将编译方法的选择覆盖它们的用途。

so you can change the delimeters Hogan uses by passing the compile method an option overriding them.

http://comments.gmane.org/ gmane.comp.lang.javascript.ex preSS / 1426

NB

海事组织使用模板系统也没用使用angularjs因为
http://stackoverflow.com/a/20270422/356380

imo using a template system is useless using angularjs because of http://stackoverflow.com/a/20270422/356380

这篇关于HoganJs和AngularJs用的NodeJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆