当我使用百里香时,如何编写自定义指令?
偏离主题:例如,我看到如果您在输入标记中使用Profiler Agent: Waiting for connection on port 5140 (Protocol version: 16)
,则应使用required
如何为自定义指令执行此操作,因为我收到此错误:
org.xml.sax.SAXParseException:属性需要打开引号 "是电子邮件"与元素类型相关联"输入"。
当我使用此标签时:
th:required="required"
自定义指令:
<input type="email" id="clientEmail" name="clientEmail" class="form-control" ng-model="c.email" th:required="required" minlength="5"
is-email={{c.email}} />
答案 0 :(得分:1)
<input type="email" id="clientEmail" name="clientEmail" class="form-control" ng-model="c.email" th:required="required" minlength="5"
is-email={{c.email}} />
将此更改为
<input type="email" id="clientEmail" name="clientEmail" class="form-control" ng-model="c.email" th:required="required" minlength="5"
is-email="{{c.email}}" />
您忘了提及"{{c.email}}"
引语