7
此示例來自angularjs's docs上聚焦顯示工具提示自舉時的角度輸入有錯誤
<form name="myForm" ng-controller="Ctrl">
userType: <input name="input" ng-model="userType" required>
<span class="error" ng-show="myForm.input.$error.required">Required!</span>
</form>
我想達到相同的行爲,但與引導工具提示作出。我已經看過了Angular UI-Bootstraped項目(http://angular-ui.github.io/bootstrap/),但無法弄清楚如何做到這一點。
喜歡的東西:
<input type="text" value="Click me!"
tooltip="See? Now click away..."
tooltip-trigger="focus"
tooltip-placement="right"
tooltip-enabled="myForm.input.$error.required" <--- pseudo code
/>
看看是否有幫助:「[在自定義事件上啓用angular-ui工具提示](http://stackoverflow.com/questions/16651227/enable-angular-ui-tooltip-on-custom-events/16653079#16653079) 」。 – Stewie