如果用户从元素或字段中失去焦点,如何调用-ng-blur
,我尝试使用角度ng-blur
,但它对我不起作用,任何想法如何在用户失去时实现这一点或任何更好的方法从输入字段开始关注?
main.html中
<md-input-container flex="100">
<md-chips flex="100" ng-model="notifyCtrl.cc" name="email"
placeholder="Add Cc" md-separator-keys="customKeys"
md-transform-chip="addChips($chip)" ng-blur="blurCc()">
</md-chips>
<p style="color:red" ng-show="patternError">An email must contain a-z, A-Z, 0-9, or _ characters</p>
</md-input-container>
Ctrl.js
$scope.blurCc = function() {
$scope.patternError = false;
console.log('blur called');
}