我正面临 Angular 的问题。我的代码很简单,但 ng-hide 不起作用。当用户修改注册表单的按钮时,我想隐藏部分代码。你可以帮帮我吗?
<body ng-app="myApp" ng-controller="formCtrl">
<form name="signUpForm" ng-submit="signUpFormSubmit(signUpForm.$valid)" novalidate>
<input type="text" placeholder="Email address *" name="signUpEmail">
<input type="text" placeholder="Pseudo *" name="signUpPseudo">
<input type="password" placeholder="Password *" name="signUpPassword">
<button type="submit" class="button button-block button-positive">Sign Up</button>
<div ng-hide="signUpForm.signUpEmail.$pristine || signUpForm.signUpPseudo.$pristine || signUpForm.signUpPassword.$pristine">
<hr>
<div class="padding-horizontal">
<h4 class="center">You already have an account?</h4>
<button class="button button-block button-stable">Sign In</button>
</div>
</div>
</form>
这是一个 JsFiddle:http: //jsfiddle.net/9ce63mno/3/
更新:虽然我不知道为什么在这种情况下需要控制器,但我添加了一个。我还定义了 ng-app。
谢谢