我忙用Angular2/Nativescript應用程序,並運行了一些問題輸入一個日期...我想使用的DatePicker組件,但由於某些原因,日期選取器應該在視圖上顯示的地方沒有渲染。我通過(很有限)Nativescript DatePicker文檔閱讀,但不幸的是,他們沒有包含任何XML示例...任何想法爲什麼我的DatePicker沒有顯示出來?我覺得挺卡住,覺得很奇怪,還有的Nativescript的DatePicker頁面上那麼一點信息...Angular2/NativeScript:DatePicker的完全不和Nativescript DatePicker的文檔幾乎不存在顯示
我的視圖代碼:
<StackLayout class="page">
<StackLayout *ngIf="!invoiceInProgress && !captureInProgress">
<StackLayout class="form">
<stackLayout class="input-field">
<TextField class="input input-border" hint="Enter Order Number" [(ngModel)]="orderNumber"></TextField>
</stackLayout>
<Button class="btn btn-primary" text="Verify Order Number" (tap)="verifyOrderNumber()" [isEnabled]="orderNumber !== '' && orderNumber != null"></Button>
</StackLayout>
</StackLayout>
<StackLayout *ngIf="invoiceInProgress">
<Label class="h1 title m-x-auto" text="Invoice details"></Label>
<StackLayout class="form">
<StackLayout class="input-field">
<TextField class="input input-border" hint="Enter Invoice Number"></TextField>
</StackLayout>
</StackLayout>
<DatePicker #invoiceDatePicker [(ngModel)]="invoiceDate"></DatePicker>
</StackLayout>
</StackLayout>
and in my controller:
invoiceDate: Date = new Date("2017/01/01");
你確定正在顯示您的stacklayout?具有'* ngIf =「invoiceInProgress」' – elvismercado
是的它顯示的是...請刪除此答案。在未來,我想你應該在添加註釋部分添加問題... – user2094257
我會建議使用日期選擇器插件:https://www.npmjs.com/package/nativescript-timedatepicker –