2015-03-25 174 views
1

是angularJS和Thymeleaf的新手,并且遇到一些奇怪的冲突。AngularJS和Thymeleaf之间的冲突

这就是我下面

<input type="text" th:field="*{unit}" value="{{unit.unitID}}" class="unit_value"/> 

每当模板解决,并在浏览器中显示的值设置为空的,因为在这样的

<input class="unit_value" type="text" value="" id="unit" name="unit" /> 

我不具有angularJS表达式中的值。

我知道表情和百里香的含义是同义的,我真的不知道如何解决这个问题。

我到处搜索,但无法获得解决方案。

+0

如果你想将该值绑定到作用域变量,你可以使用'ng-bind =“unit.unitID”' – 2015-03-25 13:00:29

+0

你是否正在为服务器端值(thymeleaf)或客户端端值角)? – 2015-09-25 15:07:24

回答

1

我找到了解决办法是从字面上标记自己和releave thymeleaf从绑定它是只是把预期产生的HTML thymeleaf会产生

<input type="text" name="unit" value="{{unit.unitID}}" class="unit_value"/> 

,一切工作正常进行绑定。