2015-03-25 98 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"/> 

,一切工作正常進行綁定。