2016-04-28 61 views
0

我使用spring 4.2.5,thymeleaf 2.1.4。問題是,當我在中使用Html時,會導致異常。下面Angular指令導致org.thymeleaf.exceptions.TemplateInputException

<input type="password" name="password" placeholder="Password" 
ng-minlength="6" ensure-same ng-required="true" required/> 

org.thymeleaf.exceptions.TemplateInputException

HTML代碼中的萬阿英,蔣達清是ng-minlengthensure-samerequired。如何解決它?

回答

0

使用data-ng-minlength =「6」且required =「required」。

您需要在角度指令前添加'data-'。默認情況下,angular會同時使用和不使用數據前綴,數據前綴是自定義屬性的html標準。

順便說一句,我強烈建議你不要混合角和tymeleaf,如果不是絕對強制性的。讓你的靜態資產比Spring(web服務器/ cdn)服務更容易,並且讓spring只提供json rest api來訪問角色。