我想在clojure luminus模板中使用angularjs。下面是我用luminus编写的代码。
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<div ng-app="">
<p>Name : <input type="text" ng-model="name"></p>
<h1>Hello {{name}}</h1>
</div>
但未获取{{name}}值。请提前告诉我如何解决这个issue.thanks!
发布于 2016-11-04 03:46:30
默认情况下,光源使用的是Selmer模板系统。Selmer -为您提供重新定义:tag-open :tag-close :filter-open :filter-close标记的选项。
因此,如果您将render函数更改为如下所示:
(defn render
"renders the HTML template located relative to resources/templates"
[template & [params]]
(content-type
(ok
(parser/render-file
template
(assoc params
:page template
:csrf-token *anti-forgery-token*
:servlet-context *app-context*) {:tag-open \[ :tag-close \] :filter-open \[ :filter-close \[}))
"text/html; charset=utf-8"))您将能够使用角度标记,但您必须用[% %]替换所有的Selmer标记。此外,您可以使用任何您想要的作为开始/结束标记。Foe示例<和>
https://stackoverflow.com/questions/38657669
复制相似问题