angular.js - When the submit button in angular is clicked, how can the hide prompt text be shown? ? ng-show='What is written here'
阿神
阿神 2017-05-15 17:02:27
0
2
612

The submit button in angular is clicked. Then, hide the prompt text and show? ?

阿神
阿神

闭关修行中......

reply all(2)
仅有的幸福

What the questioner wants to ask is how to replace the text in the button? Bind a click event to the button to change a variable that identifies the state, and then determine what content is displayed through the variable.

PHPzhong

Define a variable to control and change the value of your variable in the submit event, for example
html

<button ng-click="submitFunc()" ng-show="btnShow" style="display:none;">提交前</button>
<button  ng-hide="btnShow" style="display:none;">提交后</button>
<p ng-hide="btnShow" style="display:none;">提交后显示的文字</p>

js

$scope.btnShow=true;
$scope.submitFunc=function(){
  $scope.btnShow=fasle;
  //以下是你点击提交的其他代码
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template