Skip to content

Commit f4901b1

Browse files
style(all): add types for all @input members
This is needed for the API doc extraction. Closes ng-bootstrap#218
1 parent 44adfd7 commit f4901b1

File tree

10 files changed

+15
-15
lines changed

10 files changed

+15
-15
lines changed

src/accordion/accordion.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ var nextId = 0;
3333
directives: [NgbCollapse]
3434
})
3535
export class NgbPanel {
36-
@Input() disabled = false;
37-
@Input() id = `ngb-panel-${nextId++}`;
38-
@Input() open = false;
36+
@Input() disabled: boolean = false;
37+
@Input() id: string = `ngb-panel-${nextId++}`;
38+
@Input() open: boolean = false;
3939
@Input() title: string;
4040

4141
constructor(@Optional() @Inject(forwardRef(() => NgbAccordion)) private accordion: NgbAccordion) {}

src/alert/alert.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import {Component, Input, Output, EventEmitter, ChangeDetectionStrategy} from '@
1313
`
1414
})
1515
export class NgbAlert {
16-
@Input() dismissible = true;
17-
@Input() type = 'warning';
16+
@Input() dismissible: boolean = true;
17+
@Input() type: string = 'warning';
1818
@Output() close = new EventEmitter();
1919

2020
closeHandler() { this.close.emit(null); }

src/dropdown/dropdown.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {Directive, Input, HostListener} from '@angular/core';
33
@Directive(
44
{selector: '[ngbDropdown]', exportAs: 'ngbDropdown', host: {'[class.open]': 'open', '(keyup.esc)': 'close()'}})
55
export class NgbDropdown {
6-
@Input() open = false;
6+
@Input() open: boolean = false;
77

88
close() { this.open = false; }
99
}

src/modal/modal_window.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import {ModalDismissReasons} from './modal_dismiss_reasons';
2020
`
2121
})
2222
export class NgbModalWindow {
23-
@Input() backdrop = true;
24-
@Input() keyboard = true;
23+
@Input() backdrop: boolean = true;
24+
@Input() keyboard: boolean = true;
2525
@Input() size: string;
2626

2727
@Output('close') closeEvent = new EventEmitter();

src/pager/pager.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import {Component, ChangeDetectionStrategy, OnChanges, Input, Output, EventEmitt
1414
})
1515
export class NgbPager implements OnChanges {
1616
private _currentPage = 0; // internal state
17-
@Input() noOfPages = 0;
18-
@Input() page = 0;
17+
@Input() noOfPages: number = 0;
18+
@Input() page: number = 0;
1919
@Output() pageChange = new EventEmitter();
2020

2121
prev(): void {

src/popover/popover.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ import {Component, Input, ChangeDetectionStrategy} from '@angular/core';
1111
`
1212
})
1313
export class NgbPopoverWindow {
14-
@Input() placement = 'top';
14+
@Input() placement: string = 'top';
1515
@Input() title: string;
1616
}

src/progressbar/progressbar.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {getValueInRange, toBoolean} from '../util/util';
1313
`
1414
})
1515
export class NgbProgressbar {
16-
@Input() max = 100;
16+
@Input() max: number = 100;
1717
@Input() striped: boolean | string;
1818
@Input() type: string;
1919
@Input() value: number;

src/rating/rating.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class NgbRating implements OnInit {
1515
private _oldRate: number;
1616
range: number[] = [];
1717

18-
@Input() max = 10;
18+
@Input() max: number = 10;
1919
@Input() rate: number;
2020
@Input() readonly: boolean;
2121

src/tabset/tabset.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class NgbTab {
4747
export class NgbTabset implements AfterContentChecked {
4848
@ContentChildren(NgbTab) tabs: QueryList<NgbTab>;
4949

50-
@Input() activeIdx = 0;
50+
@Input() activeIdx: number = 0;
5151

5252
select(tabIdx: number) { this.activeIdx = tabIdx; }
5353

src/tooltip/tooltip.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ import {Component, Input, ChangeDetectionStrategy} from '@angular/core';
1010
`
1111
})
1212
export class NgbTooltipWindow {
13-
@Input() placement = 'top';
13+
@Input() placement: string = 'top';
1414
}

0 commit comments

Comments
 (0)