Hi i am trying to build login form in asp.net environment that using angular to validate the input fields.
the problem is when i add
data-ng-controller="loginC"
disruptive other data-ng properties for example the user name is indeed valid but it still show me an error.
<input type="text" name="username" placeholder="username" data-ng-model="class="ng-pristine ng-untouched ng-valid" vm.username" data-ng-required="true" >
and the condition for the span is
<span data-ng-show="form.username.$invalid && form.username.$touched"
class="help-block">Username is required</span>
this is the whole code:
<asp:Content ID="Content2" ContentPlaceHolderID="beforeLogin" Runat="Server">
<div class="text-center" style="padding: 50px 0">
<!-- Main Form -->
<div class="login-form-1 " style="padding: 1%; border-radius: 10%">
<div class="logo">Login</div>
<section class="card register" data-ng-app="Login" data-ng-controller="loginC">
<form name="form" class="text-left" data-ng-submit="vm.login()">
<div class="login-form-main-message login-group"></div>
<fieldset>
<div class="form-group" data-ng-class="{ 'has-error': form.username.$invalid && form.username.$touched}">
<input type="text" name="username" placeholder="username" data-ng-model="vm.username" data-ng-required="true" />
<span data-ng-show="form.username.$invalid && form.username.$touched" class="help-block">Username is required</span>
</div>
<div class="form-group" data-ng-class="{ 'has-error': form.password.$invalid && form.password.$touched }">
<input type="password" name="password" id="password" placeholder="Password" class="form-control" data-ng-model="vm.password" data-ng-required="true" />
<span data-ng-show="form.password.$invalid && form.password.$touched" class="help-block">Password is required</span>
</div>
<div class="form-actions" style="margin: 0 auto; width: 40%;">
<button type="submit" data-ng-disabled="form.$invalid || vm.dataLoading" class="btn btn-primary">Login</button>
<a href="Registration.aspx" class="btn btn-link">Register</a>
</div>
</fieldset>
</form>
</section>
</div>
<!-- end:Main Form -->
</div>
note again when i am remove the data-ng-controller everything work good