Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4d90a68

Browse files
committedOct 17, 2024·
hotfix(typescript): some angular setups can't handle .forRoot() returning just module
1 parent 2c7d6f0 commit 4d90a68

File tree

18 files changed

+104
-51
lines changed

18 files changed

+104
-51
lines changed
 

‎apps/ngx-bootstrap-docs/src/assets/css/style.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
@import "bs-datepicker";
33

44
/* HEADER */
5-
5+
.bs-datepicker-head {
6+
width: 150px;
7+
}
68
header {
79
padding: 10px 50px 10px 30px;
810
height: $header-height;

‎src/accordion/accordion.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22

33
import { AccordionComponent } from './accordion.component';
44
import { AccordionPanelComponent } from './accordion-group.component';
@@ -9,7 +9,10 @@ import { AccordionPanelComponent } from './accordion-group.component';
99
})
1010
export class AccordionModule {
1111
// @deprecated method not required anymore, will be deleted in v19.0.0
12-
static forRoot() {
13-
return AccordionModule;
12+
static forRoot(): ModuleWithProviders<AccordionModule> {
13+
return {
14+
ngModule: AccordionModule,
15+
providers: []
16+
};
1417
}
1518
}

‎src/alert/alert.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22
import { AlertComponent } from './alert.component';
33

44
@NgModule({
@@ -7,7 +7,10 @@ import { AlertComponent } from './alert.component';
77
})
88
export class AlertModule {
99
// @deprecated method not required anymore, will be deleted in v19.0.0
10-
static forRoot() {
11-
return AlertModule;
10+
static forRoot(): ModuleWithProviders<AlertModule> {
11+
return {
12+
ngModule: AlertModule,
13+
providers: []
14+
};
1215
}
1316
}

‎src/buttons/buttons.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22

33
import { ButtonCheckboxDirective } from './button-checkbox.directive';
44
import { ButtonRadioDirective } from './button-radio.directive';
@@ -10,7 +10,10 @@ import { ButtonRadioGroupDirective } from './button-radio-group.directive';
1010
})
1111
export class ButtonsModule {
1212
// @deprecated method not required anymore, will be deleted in v19.0.0
13-
static forRoot() {
14-
return ButtonsModule;
13+
static forRoot(): ModuleWithProviders<ButtonsModule> {
14+
return {
15+
ngModule: ButtonsModule,
16+
providers: []
17+
};
1518
}
1619
}

‎src/carousel/carousel.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22

33
import { CarouselComponent } from './carousel.component';
44
import { SlideComponent } from './slide.component';
@@ -9,7 +9,10 @@ import { SlideComponent } from './slide.component';
99
})
1010
export class CarouselModule {
1111
// @deprecated method not required anymore, will be deleted in v19.0.0
12-
static forRoot() {
13-
return CarouselModule;
12+
static forRoot(): ModuleWithProviders<CarouselModule> {
13+
return {
14+
ngModule: CarouselModule,
15+
providers: []
16+
};
1417
}
1518
}

‎src/collapse/collapse.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22

33
import { CollapseDirective } from './collapse.directive';
44

@@ -8,7 +8,10 @@ import { CollapseDirective } from './collapse.directive';
88
})
99
export class CollapseModule {
1010
// @deprecated method not required anymore, will be deleted in v19.0.0
11-
static forRoot() {
12-
return CollapseModule;
11+
static forRoot(): ModuleWithProviders<CollapseModule> {
12+
return {
13+
ngModule: CollapseModule,
14+
providers: []
15+
};
1316
}
1417
}

‎src/datepicker/bs-datepicker.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule } from '@angular/core';
2+
import { ModuleWithProviders, NgModule } from '@angular/core';
33

44
import { TooltipModule } from 'ngx-bootstrap/tooltip';
55
import { TimepickerModule } from 'ngx-bootstrap/timepicker';
@@ -64,7 +64,10 @@ import { BsYearsCalendarViewComponent } from './themes/bs/bs-years-calendar-view
6464
})
6565
export class BsDatepickerModule {
6666
// @deprecated method not required anymore, will be deleted in v19.0.0
67-
static forRoot() {
68-
return BsDatepickerModule;
67+
static forRoot(): ModuleWithProviders<BsDatepickerModule> {
68+
return {
69+
ngModule: BsDatepickerModule,
70+
providers: []
71+
};
6972
}
7073
}

‎src/dropdown/bs-dropdown.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22

33
import { BsDropdownContainerComponent } from './bs-dropdown-container.component';
44
import { BsDropdownMenuDirective } from './bs-dropdown-menu.directive';
@@ -21,7 +21,10 @@ import { BsDropdownDirective } from './bs-dropdown.directive';
2121
})
2222
export class BsDropdownModule {
2323
// @deprecated method not required anymore, will be deleted in v19.0.0
24-
static forRoot() {
25-
return BsDropdownModule;
24+
static forRoot(): ModuleWithProviders<BsDropdownModule> {
25+
return {
26+
ngModule: BsDropdownModule,
27+
providers: []
28+
};
2629
}
2730
}

‎src/focus-trap/focus-trap.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33

44
import { FocusTrapDirective } from './focus-trap';
@@ -9,7 +9,10 @@ import { FocusTrapDirective } from './focus-trap';
99
})
1010
export class FocusTrapModule {
1111
// @deprecated method not required anymore, will be deleted in v19.0.0
12-
static forRoot() {
13-
return FocusTrapModule;
12+
static forRoot(): ModuleWithProviders<FocusTrapModule> {
13+
return {
14+
ngModule: FocusTrapModule,
15+
providers: []
16+
};
1417
}
1518
}

‎src/pagination/pagination.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule } from '@angular/core';
2+
import { ModuleWithProviders, NgModule } from '@angular/core';
33

44
import { PagerComponent } from './pager.component';
55
import { PaginationComponent } from './pagination.component';
@@ -10,7 +10,10 @@ import { PaginationComponent } from './pagination.component';
1010
})
1111
export class PaginationModule {
1212
// @deprecated method not required anymore, will be deleted in v19.0.0
13-
static forRoot() {
14-
return PaginationModule;
13+
static forRoot(): ModuleWithProviders<PaginationModule> {
14+
return {
15+
ngModule: PaginationModule,
16+
providers: []
17+
};
1518
}
1619
}

‎src/popover/popover.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33

44
import { PopoverDirective } from './popover.directive';
@@ -10,7 +10,10 @@ import { PopoverContainerComponent } from './popover-container.component';
1010
})
1111
export class PopoverModule {
1212
// @deprecated method not required anymore, will be deleted in v19.0.0
13-
static forRoot() {
14-
return PopoverModule;
13+
static forRoot(): ModuleWithProviders<PopoverModule> {
14+
return {
15+
ngModule: PopoverModule,
16+
providers: []
17+
};
1518
}
1619
}

‎src/progressbar/progressbar.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22

33
import { BarComponent } from './bar.component';
44
import { ProgressbarComponent } from './progressbar.component';
@@ -9,7 +9,10 @@ import { ProgressbarComponent } from './progressbar.component';
99
})
1010
export class ProgressbarModule {
1111
// @deprecated method not required anymore, will be deleted in v19.0.0
12-
static forRoot() {
13-
return ProgressbarModule;
12+
static forRoot(): ModuleWithProviders<ProgressbarModule> {
13+
return {
14+
ngModule: ProgressbarModule,
15+
providers: []
16+
};
1417
}
1518
}

‎src/rating/rating.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22

33
import { RatingComponent } from './rating.component';
44

@@ -8,7 +8,10 @@ import { RatingComponent } from './rating.component';
88
})
99
export class RatingModule {
1010
// @deprecated method not required anymore, will be deleted in v19.0.0
11-
static forRoot() {
12-
return RatingModule;
11+
static forRoot(): ModuleWithProviders<RatingModule> {
12+
return {
13+
ngModule: RatingModule,
14+
providers: []
15+
};
1316
}
1417
}

‎src/sortable/sortable.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22

33
import { SortableComponent } from './sortable.component';
44

@@ -8,7 +8,10 @@ import { SortableComponent } from './sortable.component';
88
})
99
export class SortableModule {
1010
// @deprecated method not required anymore, will be deleted in v19.0.0
11-
static forRoot() {
12-
return SortableModule;
11+
static forRoot(): ModuleWithProviders<SortableModule> {
12+
return {
13+
ngModule: SortableModule,
14+
providers: []
15+
};
1316
}
1417
}

‎src/tabs/tabs.module.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ import { TabsetComponent } from './tabset.component';
2020
})
2121
export class TabsModule {
2222
// @deprecated method not required anymore, will be deleted in v19.0.0
23-
static forRoot() {
24-
return TabsModule;
23+
static forRoot(): ModuleWithProviders<TabsModule> {
24+
return {
25+
ngModule: TabsModule,
26+
providers: []
27+
};
2528
}
2629
}

‎src/timepicker/timepicker.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22

33
import { TimepickerComponent } from './timepicker.component';
44

@@ -8,7 +8,10 @@ import { TimepickerComponent } from './timepicker.component';
88
})
99
export class TimepickerModule {
1010
// @deprecated method not required anymore, will be deleted in v19.0.0
11-
static forRoot() {
12-
return TimepickerModule;
11+
static forRoot(): ModuleWithProviders<TimepickerModule> {
12+
return {
13+
ngModule: TimepickerModule,
14+
providers: []
15+
};
1316
}
1417
}

‎src/tooltip/tooltip.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule } from '@angular/core';
2+
import { ModuleWithProviders, NgModule } from '@angular/core';
33
import { TooltipContainerComponent } from './tooltip-container.component';
44
import { TooltipDirective } from './tooltip.directive';
55

@@ -9,7 +9,10 @@ import { TooltipDirective } from './tooltip.directive';
99
})
1010
export class TooltipModule {
1111
// @deprecated method not required anymore, will be deleted in v19.0.0
12-
static forRoot() {
13-
return TooltipModule;
12+
static forRoot(): ModuleWithProviders<TooltipModule> {
13+
return {
14+
ngModule: TooltipModule,
15+
providers: []
16+
};
1417
}
1518
}

‎src/typeahead/typeahead.module.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common';
2-
import { NgModule } from '@angular/core';
2+
import { ModuleWithProviders, NgModule } from '@angular/core';
33

44
import { TypeaheadContainerComponent } from './typeahead-container.component';
55
import { TypeaheadDirective } from './typeahead.directive';
@@ -10,7 +10,10 @@ import { TypeaheadDirective } from './typeahead.directive';
1010
})
1111
export class TypeaheadModule {
1212
// @deprecated method not required anymore, will be deleted in v19.0.0
13-
static forRoot() {
14-
return TypeaheadModule;
13+
static forRoot(): ModuleWithProviders<TypeaheadModule> {
14+
return {
15+
ngModule: TypeaheadModule,
16+
providers: []
17+
};
1518
}
1619
}

0 commit comments

Comments
 (0)
Please sign in to comment.