Skip to content

Commit

Permalink
fix(datepicker): fix errors on fullTemplateTypeCheck rule (#3462)
Browse files Browse the repository at this point in the history
fixes #3455
  • Loading branch information
dukakent authored and valorkin committed Jan 18, 2018
1 parent dfd489b commit 446587e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
3 changes: 3 additions & 0 deletions demo/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
"typeRoots": [
"../node_modules/@types"
]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true
}
}
13 changes: 4 additions & 9 deletions src/datepicker/datepicker-inner.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,18 @@ export class DatePickerInnerComponent implements OnInit, OnChanges {
@Input() dateDisabled: { date: Date; mode: string }[];
@Input() initDate: Date;

@Output()
selectionDone: EventEmitter<Date> = new EventEmitter<Date>(undefined);

@Output() selectionDone: EventEmitter<Date> = new EventEmitter<Date>(undefined);
@Output() update: EventEmitter<Date> = new EventEmitter<Date>(false);

@Output()
activeDateChange: EventEmitter<Date> = new EventEmitter<Date>(
undefined
);
@Output() activeDateChange: EventEmitter<Date> = new EventEmitter<Date>(undefined);

stepDay: any = {};
stepMonth: any = {};
stepYear: any = {};

uniqueId: string;

protected modes: string[] = ['day', 'month', 'year'];
protected dateFormatter: DateFormatter = new DateFormatter();
protected uniqueId: string;
protected _activeDate: Date;
protected selectedDate: Date;
protected activeDateId: string;
Expand Down
4 changes: 2 additions & 2 deletions src/datepicker/daypicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DatePickerInnerComponent } from './datepicker-inner.component';
@Component({
selector: 'daypicker',
template: `
<table *ngIf="datePicker.datepickerMode==='day'" role="grid" [attr.aria-labelledby]="datePicker.uniqueId+'-title'" aria-activedescendant="activeDateId">
<table *ngIf="datePicker.datepickerMode === 'day'" role="grid" [attr.aria-labelledby]="datePicker.uniqueId + '-title'" aria-activedescendant="activeDateId">
<thead>
<tr>
<th>
Expand All @@ -25,7 +25,7 @@ import { DatePickerInnerComponent } from './datepicker-inner.component';
<th [attr.colspan]="5 + (datePicker.showWeeks ? 1 : 0)">
<button [id]="datePicker.uniqueId + '-title'"
type="button" class="btn btn-default btn-secondary btn-sm"
(click)="datePicker.toggleMode()"
(click)="datePicker.toggleMode(0)"
[disabled]="datePicker.datepickerMode === datePicker.maxMode"
[ngClass]="{disabled: datePicker.datepickerMode === datePicker.maxMode}" tabindex="-1" style="width:100%;">
<strong>{{ title }}</strong>
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/monthpicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { DatePickerInnerComponent } from './datepicker-inner.component';
<th [attr.colspan]="((datePicker.monthColLimit - 2) <= 0) ? 1 : datePicker.monthColLimit - 2">
<button [id]="datePicker.uniqueId + '-title'"
type="button" class="btn btn-default btn-sm"
(click)="datePicker.toggleMode()"
(click)="datePicker.toggleMode(0)"
[disabled]="datePicker.datepickerMode === maxMode"
[ngClass]="{disabled: datePicker.datepickerMode === maxMode}" tabindex="-1" style="width:100%;">
<strong>{{ title }}</strong>
Expand Down
10 changes: 5 additions & 5 deletions src/datepicker/themes/bs/bs-datepicker-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div *ngSwitchCase="'day'">
<bs-days-calendar-view
*ngFor="let calendar of (daysCalendar | async)"
[class.bs-datepicker-multiple]="(daysCalendar | async).length > 1"
[class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"
[calendar]="calendar"
[options]="options | async"
(onNavigate)="navigateTo($event)"
Expand All @@ -21,8 +21,8 @@
<!--months calendar-->
<div *ngSwitchCase="'month'">
<bs-month-calendar-view
*ngFor="let calendar of (monthsCalendar | async)"
[class.bs-datepicker-multiple]="(daysCalendar | async).length > 1"
*ngFor="let calendar of (monthsCalendar | async)"
[class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"
[calendar]="calendar"
(onNavigate)="navigateTo($event)"
(onViewMode)="setViewMode($event)"
Expand All @@ -34,8 +34,8 @@
<!--years calendar-->
<div *ngSwitchCase="'year'">
<bs-years-calendar-view
*ngFor="let calendar of (yearsCalendar | async)"
[class.bs-datepicker-multiple]="(daysCalendar | async).length > 1"
*ngFor="let calendar of (yearsCalendar | async)"
[class.bs-datepicker-multiple]="(daysCalendar | async)?.length > 1"
[calendar]="calendar"
(onNavigate)="navigateTo($event)"
(onViewMode)="setViewMode($event)"
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker/yearpicker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { DatePickerInnerComponent } from './datepicker-inner.component';
<th [attr.colspan]="((datePicker.yearColLimit - 2) <= 0) ? 1 : datePicker.yearColLimit - 2">
<button [id]="datePicker.uniqueId + '-title'" role="heading"
type="button" class="btn btn-default btn-sm"
(click)="datePicker.toggleMode()"
(click)="datePicker.toggleMode(0)"
[disabled]="datePicker.datepickerMode === datePicker.maxMode"
[ngClass]="{disabled: datePicker.datepickerMode === datePicker.maxMode}" tabindex="-1" style="width:100%;">
<strong>{{ title }}</strong>
Expand Down
4 changes: 3 additions & 1 deletion src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"outDir": "../dist",
"rootDir": "./",
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
Expand Down Expand Up @@ -33,6 +34,7 @@
"angularCompilerOptions": {
"genDir": "../temp/factories",
"strictMetadataEmit": true,
"skipTemplateCodegen": true
"skipTemplateCodegen": true,
"fullTemplateTypeCheck": true
}
}

0 comments on commit 446587e

Please sign in to comment.