我正在编写一个角度应用程序,其中一个文本框接受电话号码。用户可以输入字母数字值作为示例
<input class="form-control" ng-pattern = "/^\+?\d{1,3}[- ]?\d{3}[- ]?\d{5}$/" name="field_{{ listIndex }}" placeholder="" type="text" ng-model="phoneData['phone3']"minlength ="12" maxlength="100" name="field_{{ listIndex }}" style="display:inline-block; width:230px" />
我尝试使用ng-patern,但似乎没有完全按照我想要的方式工作
我的代码 -
<div *ngIf="vehicles">
<p-dataTable [value]="vehicles.dallases" expandableRows="true">
<p-header>List of vehicles: <b>{{currentUser}}</b></p-header>
<p-column expander="true" styleClass="col-icon"></p-column>
<p-column field="vehicle_id" header="Vehicle ID" [sortable]="true"></p-column>
<p-column field="dallassettings" header="Dallas settings" [sortable]="true"></p-column>
<p-column field="dallasupdated" header="Dallas updated" [sortable]="true"></p-column>
<ng-template let-vehicle pTemplate="rowexpansion"> <!-- the problem is here -->
<div class="ui-grid ui-grid-responsive ui-fluid" style="font-size:16px;padding:20px">
<div class="ui-grid-row">
<div class="ui-grid-col-9">
<div class="ui-grid ui-grid-responsive ui-grid-pad" *ngFor="let list of vehicle.dallas_list">
<div class="ui-grid-row">
<div class="ui-grid-col-2 label">Number: </div>
<div class="ui-grid-col-10">{{list.number}}</div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-2 label">Auth: </div>
<div class="ui-grid-col-10">{{list.auth}}</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</p-dataTable>
有人可以帮我写上面的电话号码吗?