代码如下:
import { AbstractControl, ValidatorFn } from '@angular/forms';
export class NumberValidators {
static isNumberCheck(): ValidatorFn {
return (c: AbstractControl): {[key: string]: boolean} | null => {
if (c.value !== undefined && (isNaN(c.value))) {
return { 'value': true };
}
return null;
};
}
}
Run Code Online (Sandbox Code Playgroud)
但我遇到的问题是,当我输入一个十进制值时,它会提高我不想要的验证标志.我希望输入字段有整数和十进制数.有人可以帮我解决这个问题.
下面是我使用parsleyjs进行验证的模板代码
<div class="form-group row">
<label for="upperbeltposition" class="col-md-6 col-form-label">Upper Belt Position (mm) <span class="required">*</span></label>
<div class="col-md-5">
<input class="form-control input-transparent " id="upperbeltposition" type="text" formControlName="upperbeltposition" data-parsley-trigger="blur"
required="required" data-parsley-type="number"/>
</div>
</div>
<div class="form-group row">
<label for="platformxposition" class="col-md-6 col-form-label">Platform …Run Code Online (Sandbox Code Playgroud)任何人都可以帮助我将此查询转换为HQL
SELECT
supplierOrderDetails.productID,
supplierOrderDetails.orderQty,
supplierOrderReceiveDetail.qtyArrived
FROM
supplierOrder
INNER JOIN
supplierOrderDetails
ON
(supplierOrderDetails.supplierOrderID = supplierOrder.ID)
INNER JOIN
supplierOrderReceive
ON
(supplierOrderReceive.supplierOrderID = supplierOrder.ID)
INNER JOIN
supplierOrderReceiveDetail
ON
(supplierOrderReceiveDetail.supplierOrderReceiveID = supplierOrderReceive.ID)
AND
(supplierOrderReceiveDetail.ProductID =supplierOrderDetails.ProductID)
WHERE supplierOrder.ID = 1
Run Code Online (Sandbox Code Playgroud)
这是表关系

我正在尝试在我的 Zebra Z410 标签打印机上打印波斯字符。但由于某种原因,它正在打印 ?????。我发送到打印机的 ZPL 代码是
^XA
^FO50,50
^PA1,1,1,1
^A@N,50,50,E:TT0003M_.TTF^FD??????????^FS
^XZ
Run Code Online (Sandbox Code Playgroud)
我正在使用 Zebra Setup Utilities-Open 与打印机通信。请帮忙!!
我试图在我的应用程序中使用此库将JSON数据转换为CSV文件格式.我将lib安装到我的项目中,因为它提到了 https://www.npmjs.com/package/json2csv
npm install json2csv --save.
我还在node_module文件夹中看到了该模块.然后在我的组件类中,我正在调用它,
import { json2csv } from 'json2csv';
但后来我得到了这个错误
[ts]模块'"c:/ dev/angularworkspace/tntzweb/node_modules/json2csv/index"'没有导出成员'json2csv'.
有人可以帮帮我吗!!
我有一个显示客户信息的Ui.我遇到的问题是一些客户名称(android:id ="@ + id/customerName")很长,不适合textview.什么选项我可以显示它们,然后选择给名称提供完整的布局宽度或从旁边删除代码textview(如xml文件android:id ="@ + id/customerName"中所示).
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="*" >
<TableRow>
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right"
android:text="@string/customerCode" />
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right"
android:text="@string/customerName" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/customerCode"
style="@style/CustomerTextView"
android:gravity="right" />
<TextView
android:id="@+id/customerName"
style="@style/CustomerTextView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.0"
android:gravity="right"
android:maxEms="5" />
</TableRow>
<TableRow android:gravity="right" >
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right"
android:text="@string/customerAddress" />
</TableRow>
<TableRow android:gravity="right" >
<TextView
android:id="@+id/customerAddress"
style="@style/CustomerTextView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1.0"
android:gravity="right"
android:maxEms="5"
/>
</TableRow>
<TableRow>
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right"
android:text="@string/POBox" />
<TextView
style="@style/CustomerLabelTextView"
android:gravity="right" …Run Code Online (Sandbox Code Playgroud) 我正在实施一个Android应用程序,我需要在模拟器和手机上进行测试.但是当我运行应用程序时,它在手机上运行而没有询问我或向我显示我想要测试我的应用程序的选项.有人可以帮助我如何实现这一点.谢谢