Skip to content

Commit

Permalink
hotfix(typescript): some angular setups can't handle .forRoot() retur…
Browse files Browse the repository at this point in the history
…ning just module
  • Loading branch information
lexasq committed Oct 17, 2024
1 parent 2c7d6f0 commit 4d90a68
Show file tree
Hide file tree
Showing 18 changed files with 104 additions and 51 deletions.
4 changes: 3 additions & 1 deletion apps/ngx-bootstrap-docs/src/assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
@import "bs-datepicker";

/* HEADER */

.bs-datepicker-head {
width: 150px;
}
header {
padding: 10px 50px 10px 30px;
height: $header-height;
Expand Down
9 changes: 6 additions & 3 deletions src/accordion/accordion.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { AccordionComponent } from './accordion.component';
import { AccordionPanelComponent } from './accordion-group.component';
Expand All @@ -9,7 +9,10 @@ import { AccordionPanelComponent } from './accordion-group.component';
})
export class AccordionModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return AccordionModule;
static forRoot(): ModuleWithProviders<AccordionModule> {
return {
ngModule: AccordionModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/alert/alert.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { AlertComponent } from './alert.component';

@NgModule({
Expand All @@ -7,7 +7,10 @@ import { AlertComponent } from './alert.component';
})
export class AlertModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return AlertModule;
static forRoot(): ModuleWithProviders<AlertModule> {
return {
ngModule: AlertModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/buttons/buttons.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { ButtonCheckboxDirective } from './button-checkbox.directive';
import { ButtonRadioDirective } from './button-radio.directive';
Expand All @@ -10,7 +10,10 @@ import { ButtonRadioGroupDirective } from './button-radio-group.directive';
})
export class ButtonsModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return ButtonsModule;
static forRoot(): ModuleWithProviders<ButtonsModule> {
return {
ngModule: ButtonsModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/carousel/carousel.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { CarouselComponent } from './carousel.component';
import { SlideComponent } from './slide.component';
Expand All @@ -9,7 +9,10 @@ import { SlideComponent } from './slide.component';
})
export class CarouselModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return CarouselModule;
static forRoot(): ModuleWithProviders<CarouselModule> {
return {
ngModule: CarouselModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/collapse/collapse.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

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

Expand All @@ -8,7 +8,10 @@ import { CollapseDirective } from './collapse.directive';
})
export class CollapseModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return CollapseModule;
static forRoot(): ModuleWithProviders<CollapseModule> {
return {
ngModule: CollapseModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/datepicker/bs-datepicker.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { TimepickerModule } from 'ngx-bootstrap/timepicker';
Expand Down Expand Up @@ -64,7 +64,10 @@ import { BsYearsCalendarViewComponent } from './themes/bs/bs-years-calendar-view
})
export class BsDatepickerModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return BsDatepickerModule;
static forRoot(): ModuleWithProviders<BsDatepickerModule> {
return {
ngModule: BsDatepickerModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/dropdown/bs-dropdown.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { BsDropdownContainerComponent } from './bs-dropdown-container.component';
import { BsDropdownMenuDirective } from './bs-dropdown-menu.directive';
Expand All @@ -21,7 +21,10 @@ import { BsDropdownDirective } from './bs-dropdown.directive';
})
export class BsDropdownModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return BsDropdownModule;
static forRoot(): ModuleWithProviders<BsDropdownModule> {
return {
ngModule: BsDropdownModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/focus-trap/focus-trap.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { FocusTrapDirective } from './focus-trap';
Expand All @@ -9,7 +9,10 @@ import { FocusTrapDirective } from './focus-trap';
})
export class FocusTrapModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return FocusTrapModule;
static forRoot(): ModuleWithProviders<FocusTrapModule> {
return {
ngModule: FocusTrapModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/pagination/pagination.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { PagerComponent } from './pager.component';
import { PaginationComponent } from './pagination.component';
Expand All @@ -10,7 +10,10 @@ import { PaginationComponent } from './pagination.component';
})
export class PaginationModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return PaginationModule;
static forRoot(): ModuleWithProviders<PaginationModule> {
return {
ngModule: PaginationModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/popover/popover.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { PopoverDirective } from './popover.directive';
Expand All @@ -10,7 +10,10 @@ import { PopoverContainerComponent } from './popover-container.component';
})
export class PopoverModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return PopoverModule;
static forRoot(): ModuleWithProviders<PopoverModule> {
return {
ngModule: PopoverModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/progressbar/progressbar.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { BarComponent } from './bar.component';
import { ProgressbarComponent } from './progressbar.component';
Expand All @@ -9,7 +9,10 @@ import { ProgressbarComponent } from './progressbar.component';
})
export class ProgressbarModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return ProgressbarModule;
static forRoot(): ModuleWithProviders<ProgressbarModule> {
return {
ngModule: ProgressbarModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/rating/rating.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

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

Expand All @@ -8,7 +8,10 @@ import { RatingComponent } from './rating.component';
})
export class RatingModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return RatingModule;
static forRoot(): ModuleWithProviders<RatingModule> {
return {
ngModule: RatingModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/sortable/sortable.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

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

Expand All @@ -8,7 +8,10 @@ import { SortableComponent } from './sortable.component';
})
export class SortableModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return SortableModule;
static forRoot(): ModuleWithProviders<SortableModule> {
return {
ngModule: SortableModule,
providers: []
};
}
}
7 changes: 5 additions & 2 deletions src/tabs/tabs.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import { TabsetComponent } from './tabset.component';
})
export class TabsModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return TabsModule;
static forRoot(): ModuleWithProviders<TabsModule> {
return {
ngModule: TabsModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/timepicker/timepicker.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

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

Expand All @@ -8,7 +8,10 @@ import { TimepickerComponent } from './timepicker.component';
})
export class TimepickerModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return TimepickerModule;
static forRoot(): ModuleWithProviders<TimepickerModule> {
return {
ngModule: TimepickerModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/tooltip/tooltip.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { TooltipContainerComponent } from './tooltip-container.component';
import { TooltipDirective } from './tooltip.directive';

Expand All @@ -9,7 +9,10 @@ import { TooltipDirective } from './tooltip.directive';
})
export class TooltipModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return TooltipModule;
static forRoot(): ModuleWithProviders<TooltipModule> {
return {
ngModule: TooltipModule,
providers: []
};
}
}
9 changes: 6 additions & 3 deletions src/typeahead/typeahead.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';

import { TypeaheadContainerComponent } from './typeahead-container.component';
import { TypeaheadDirective } from './typeahead.directive';
Expand All @@ -10,7 +10,10 @@ import { TypeaheadDirective } from './typeahead.directive';
})
export class TypeaheadModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return TypeaheadModule;
static forRoot(): ModuleWithProviders<TypeaheadModule> {
return {
ngModule: TypeaheadModule,
providers: []
};
}
}

0 comments on commit 4d90a68

Please sign in to comment.