ng-bootstrap datepicker CSS问题-缺少glyphicon

时间:2019-03-07 07:49:09

标签: ng-bootstrap

我正在使用:

  • 角度7.2.4
  • 引导程序4.3.1
  • ng-bootstrap 4.1.0。

跟随getting-started guide on ng-bootstrap之后,我的输出如下所示:

Button

如何为“弹出”按钮添加正确的样式? 我的html:

<form class="form-inline">
    <div class="form-group">
      <div class="input-group">
        From:
        <input class="form-control" placeholder="{{format}}"
               name="FromDp" [(ngModel)]="fromDateObj" ngbDatepicker #d="ngbDatepicker">
        <div class="input-group-append">
          <button class="btn btn-outline-secondary calendar" (click)="d.toggle()" type="button"></button>
        </div>
      </div>
    </div>
  </form>

http://plnkr.co/edit/NCNmpm3tlxapH4jZS08F?p=preview

1 个答案:

答案 0 :(得分:0)

检查working demo here

如果打开stackblitz代码here-您会看到bootstrap css已添加到index.html中,并且还会在stackblitz above中检查styles.css来找到:

/* Datepicker popup icon */

button.calendar, button.calendar:active {
  width: 2.75rem;
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAcCAYAAAAEN20fAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAEUSURBVEiJ7ZQxToVAEIY/YCHGxN6XGOIpnpaEsBSeQC9ArZbm9TZ6ADyBNzAhQGGl8Riv4BLAWAgmkpBYkH1b8FWT2WK/zJ8ZJ4qiI6XUI3ANnGKWBnht2/ZBDRK3hgVGNsCd7/ui+JkEIrKtqurLpEWaphd933+IyI3LEIdpCYCiKD6HcuOa/nwOa0ScJEnk0BJg0UTUWJRl6RxCYEzEmomsIlPU3IPW+grIAbquy+q6fluy/28RIBeRMwDXdXMgXLj/B2uimRXpui4D9sBeRLKl+1N+L+t6RwbWrZliTTTr1oxYtzVWiTQAcRxvTX+eJMnlUDaO1vpZRO5NS0x48sIwfPc87xg4B04MCzQi8hIEwe4bl1DnFMCN2zsAAAAASUVORK5CYII=') !important;
  background-repeat: no-repeat;
  background-size: 23px;
  background-position: center;
}