ng-bootstrap

ngbDatepicker not working when enter button it pressed

这一生的挚爱 提交于 2021-02-10 19:15:41
问题 I am using ngbDatepicker and it works only if I select the date from the dropdown. However if I change the date via keyboard and press enter nothing happens. <div class="input-group"> <input name="datepicker" class="form-control" ngbDatepicker #datepicker="ngbDatepicker" [autoClose]="'outside'" (dateSelect)="onDateSelection($event)" [displayMonths]="2" [dayTemplate]="t" outsideDays="hidden" [startDate]="fromDate"> <ng-template #t let-date let-focused="focused"> <span class="custom-day" [class

ngbDatepicker not working when enter button it pressed

為{幸葍}努か 提交于 2021-02-10 19:14:57
问题 I am using ngbDatepicker and it works only if I select the date from the dropdown. However if I change the date via keyboard and press enter nothing happens. <div class="input-group"> <input name="datepicker" class="form-control" ngbDatepicker #datepicker="ngbDatepicker" [autoClose]="'outside'" (dateSelect)="onDateSelection($event)" [displayMonths]="2" [dayTemplate]="t" outsideDays="hidden" [startDate]="fromDate"> <ng-template #t let-date let-focused="focused"> <span class="custom-day" [class

ngbDatepicker not working when enter button it pressed

只谈情不闲聊 提交于 2021-02-10 19:09:49
问题 I am using ngbDatepicker and it works only if I select the date from the dropdown. However if I change the date via keyboard and press enter nothing happens. <div class="input-group"> <input name="datepicker" class="form-control" ngbDatepicker #datepicker="ngbDatepicker" [autoClose]="'outside'" (dateSelect)="onDateSelection($event)" [displayMonths]="2" [dayTemplate]="t" outsideDays="hidden" [startDate]="fromDate"> <ng-template #t let-date let-focused="focused"> <span class="custom-day" [class

ngbDatepicker not working when enter button it pressed

寵の児 提交于 2021-02-10 19:08:30
问题 I am using ngbDatepicker and it works only if I select the date from the dropdown. However if I change the date via keyboard and press enter nothing happens. <div class="input-group"> <input name="datepicker" class="form-control" ngbDatepicker #datepicker="ngbDatepicker" [autoClose]="'outside'" (dateSelect)="onDateSelection($event)" [displayMonths]="2" [dayTemplate]="t" outsideDays="hidden" [startDate]="fromDate"> <ng-template #t let-date let-focused="focused"> <span class="custom-day" [class

ngbDatepicker not working when enter button it pressed

女生的网名这么多〃 提交于 2021-02-10 19:08:17
问题 I am using ngbDatepicker and it works only if I select the date from the dropdown. However if I change the date via keyboard and press enter nothing happens. <div class="input-group"> <input name="datepicker" class="form-control" ngbDatepicker #datepicker="ngbDatepicker" [autoClose]="'outside'" (dateSelect)="onDateSelection($event)" [displayMonths]="2" [dayTemplate]="t" outsideDays="hidden" [startDate]="fromDate"> <ng-template #t let-date let-focused="focused"> <span class="custom-day" [class

How to set minDate for ng-bootstrap datepicker

♀尐吖头ヾ 提交于 2021-02-08 12:16:36
问题 Below is the code I am using to set the minDate <input ngbDatepicker #d="ngbDatepicker" [minDate]="minDate" [formControl]="Form.controls['dateOfBirth']"> In the component I am setting the minDate as below: public minDate: Date = void 0; constructor() { this.minDate = new Date(1950, 1, 1); } But the datepicker still shows 2007 as the minDate. Is there any thing that is missing. Let me know in case any other information is required. Thanks for your time. 回答1: From your code snippet it looks

Repeating modal content in printing mode

拥有回忆 提交于 2021-01-29 02:08:25
问题 I have issue with ng-bootstrap and latest Firefox When i`m print page in portrait mode with opened modal window, modal content cloning into 2 page https://ng-bootstrap.github.io/#/components/modal/examples May be someone known why it happen? 回答1: i fix this problem by this css rule @media print { .modal-open .wrapper { display: none; } } 来源: https://stackoverflow.com/questions/54762715/repeating-modal-content-in-printing-mode

Multiple ngb-timepicker in one form with Angular4

橙三吉。 提交于 2021-01-28 06:14:19
问题 I am using Angular 4 to create a form with start time and end time, using two ngb-timepicker. When I set the model to both of them, the first one instantiates the values for the second one. Any idea on how to instantiate them separately? My HTML looks like this: <ngb-timepicker [(ngModel)]="time1"></ngb-timepicker> <ngb-timepicker [(ngModel)]="time2"></ngb-timepicker> And my component: import {Component} from '@angular/core'; @Component({ selector: 'schedule-form', templateUrl: './schedule

How to make generic component with form control input for Angular Forms in app

北慕城南 提交于 2021-01-27 20:08:10
问题 I've created component for datepicker that I want to use in many other components in my application. I have some problems becouse it doesn't change value of parent form group control. Lets get to the code: export class DatePickerComponent { @ViewChild('input', {read: ElementRef, static: false}) inputRef: ElementRef; @Input() formName?: FormGroup; @Input() formControlName: any; constructor() { this.formControlName.setValue(['']); } onKeyPress = (event) => { const pressedKey = event.keyCode; if

angular 2 ng-bootstrap modal

那年仲夏 提交于 2021-01-27 12:12:36
问题 i open modal in app with component instead of template then i need to pass the object model to modal component, the problem is that the typescript gives error of modalRef.componentInstance not exists as property, i exactly copy the sample form demo page but again give the same error and never get the @input variable populated on modal content class, this is error Cannot set property 'model' of undefined @Component({ selector: 'company-list', templateUrl: './app/components/company/company-list