<div class="row ">
<div class="col-md-2">
<label class="control-label" for="crossValidationFolds">By</label>
</div>
<div class="col-md-4">
<input required
id="crossValidationFolds"
name="crossValidationFolds"
type="number"
class="form-control"
#crossValidationFolds="ngModel"
pattern="^(1[0-2]|[1-9])"
[(ngModel)]="crossValidationFoldsValue"
[ngClass]="crossValidationFolds.touched && crossValidationFolds.invalid?'is-invalid': crossValidationFolds.valid? '':''"
/>
</div>
<div class="col-md-4 invalid-feedback" *ngIf="crossValidationFolds.touched && crossValidationFolds.invalid">
By Value is invalid
</div>
</div>
答案 0 :(得分:0)
#crossValidationFolds {
float: left;
}
.col-md-4.invalid-feedback {
float: left;
padding-left: 20px;
}
<div class="row ">
<div class="col-md-2">
<label class="control-label" for="crossValidationFolds">By</label>
</div>
<div class="col-md-4">
<input required id="crossValidationFolds" name="crossValidationFolds" type="number" class="form-control" #crossValidationFolds="ngModel" pattern="^(1[0-2]|[1-9])" [(ngModel)]="crossValidationFoldsValue" [ngClass]="crossValidationFolds.touched && crossValidationFolds.invalid?'is-invalid': crossValidationFolds.valid? '':''"
/>
</div>
<div class="col-md-4 invalid-feedback" *ngIf="crossValidationFolds.touched && crossValidationFolds.invalid">
By Value is invalid
</div>
</div>