When not working in our solution/just using an online editor the following
code works fine:
<p>Try writing in the input field:</p>
<form name="myForm">
<input name="myInput" ng-model="myInput" required>
</form>
<p>The input's valid state is:</p>
<h1>{{myForm.myInput.$valid}}</h1>
In our solution, there is an file upload directive that we need to make
sure the "Document Name" is not empty. For some reason, the "$valid" is
null (not showing true or false). I'm not sure what I'm missing. Any
help is appreciated. Here is the code:
<form class="form-horizontal" role="form" name="planDocument">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label"
ng-model="vm.docTypeName">Document Type: {{vm.docTypeName}}</label>
</div>
<div class="form-group">
<label class="control-label"> Document Name:</label>
<input class="form-control" type="text" name="documentName"
ng-model="vm.planDocument.document_name" required>
</div>
<p>The input's valid state is:</p>
<h1>{{planDocument.documentName.$valid}}</h1> - show's empty
instead of True or False
</div>
<div class="col-xs-12">
<div class="form-group" ng-hide="hasFiles">
<label for="newDocuments">Select a new document to
Upload</label>
<input type="file" id="newDocuments" class="uploadFile"
ngf-select ng-model="files" name="fileInput">
</div>
<div class="form-group">
<input class="btn btn-primary" type="button"
ng-click="vm.fileExists(files)" value="Upload">
<input class="btn btn-primary" type="button"
ng-show="vm.uploadShowSuccessAlert"
ng-click="vm.mapPlanDocument(planDocument)" value="Map Document to Plan">
</div>
<div class="alert alert-success form-group"
ng-show="vm.FileExistsAlert">
{{vm.filesExistsShowSuccessTextAlert}}
</div>
<div class="alert alert-success form-group"
ng-show="vm.uploadShowSuccessAlert">
{{vm.uploadSuccessTextAlert}}
</div>
<div class="alert alert-info form-group"
ng-show="vm.mapShowSuccessAlert">
{{vm.mapSuccessTextAlert}}
</div>
</div>
</form>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.