没有带有"exportAs"的指令,设置为"ngbDatepicker" [英] There is no directive with "exportAs" set to "ngbDatepicker"
本文介绍了没有带有"exportAs"的指令,设置为"ngbDatepicker"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用角度4,我正在尝试添加日期选择器datepicker-popup.html我收到如下所示的错误.我没有得到什么样的错误它是.请帮帮我.
I'm using angular 4, i was trying to add datepicker while i'm using datepicker-popup.html I'm getting error as given below. I'm not getting what kind of error it is. please help me out.
datepicker-popup.html
<form class="form-inline">
<div class="form-group">
<div class="input-group">
<input class="form-control" placeholder="yyyy-mm-dd" name="dp" [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker">
<div class="input-group-append">
<button class="btn btn-outline-secondary" (click)="d.toggle()" type="button">
<img src="img/calendar-icon.svg" style="width: 1.2rem; height: 1rem; cursor: pointer;" />
</button>
</div>
</div>
</div>
</form>
<hr/>
<pre>Model: {{ model | json }}</pre>
推荐答案
请在文件中添加这两行.
Please add these two lines in your file.
import { NgbDate, NgbModule } from '@ng-bootstrap/ng-bootstrap';
并导入NgbModule.
and import the NgbModule.
imports: [NgbModule]
这篇关于没有带有"exportAs"的指令,设置为"ngbDatepicker"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文