-.html
<input type="text" ng-focus="display = false" ng-blur="display = true" ng-init="display = true"> <p ng-show="display">aaa</p>
如上述代码,focus/blur可以正常控制p标签的显示与隐藏
-.html
<input type="text" ng-focus="display = false" ng-blur="hide()" ng-init="display = true"> <p ng-show="display">aaa</p>
-controller.js
$scope.hide = function (){ $scope.display = true; };
上述代码只要focus input,display一直为false, 求解。
官网文档
一周热门 更多>