Skip to content

Commit 2c7d6f0

Browse files
authored
feat(moduleless): migrating to standalone modules support (#6669)
* feat(accordion): migrated to standalone * feat(accordion): migrated to standalone * feat(alert)): migrated to standalone * feat(buttons): migrated to standalone * feat(carousel): migrated to standalone * feat(collapse): migrated to standalone * feat(datepicker): migrated to standalone * fix(accordion): fixed tests * fix(accordion): fixed tests * fix(accordion): fixed tests * fix(accordion): fixed tests * fix(accordion): fixed tests * fix(carousel): fixed tests * feat(dropdown): added moduleless support * feat(focustrap): added moduleless support * feat(modal): added moduleless support * feat(pagination): added moduleless support * feat(popover): added moduleless support * feat(progressbar): added moduleless support * feat(rating): added moduleless support * feat(sortable): added moduleless support * feat(tabs): added moduleless support * feat(timepicker): added moduleless support * feat(timepicker): added moduleless support * feat(typeahead): added moduleless support * feat(typeahead): added moduleless support * fix(rating): tests ajust to moduleless * fix(progressbar): tests ajust to moduleless * chore(docs): added deprecations * chore(docs): updated documentation regarding standalone usage * chore(docs): updated documentation regarding standalone usage * fix(modal): fixed nested backdrop issue * 18.1.0 * chore(version): bumped version to 18.1.0
1 parent d210ca6 commit 2c7d6f0

File tree

173 files changed

+1005
-664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+1005
-664
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ import { TooltipModule } from 'ngx-bootstrap/tooltip';
106106
107107
@NgModule({
108108
...
109-
imports: [TooltipModule.forRoot(),...]
109+
imports: [TooltipModule,...]
110110
...
111111
})
112112
```

apps/ngx-bootstrap-docs/src/app/app.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { routes } from './app.routing';
1616
bootstrap: [AppComponent], imports: [BrowserAnimationsModule,
1717
DocsModule,
1818
RouterModule.forRoot(routes, { useHash: environment.useHash }),
19-
BsDropdownModule.forRoot()], providers: [
19+
BsDropdownModule], providers: [
2020
{ provide: NgApiDoc, useValue: ngdoc },
2121
{ provide: DOCS_TOKENS, useValue: routes },
2222
{ provide: SIDEBAR_ROUTES, useValue: SidebarRoutesStructure },
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "18.0.2"
2+
"version": "18.1.0"
33
}

libs/common-docs/src/lib/common/schematics/schematics.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ <h2 id="getting-started">Schematics</h2>
138138
],
139139
<span class="kwd">imports</span>: [
140140
<span class="pln"> &hellip;</span>
141-
<span class="lit">AccordionModule.forRoot()</span>,
141+
<span class="lit">AccordionModule</span>,
142142
],
143143
bootstrap: [AppComponent]
144144
<span class="pun">{{'}'}}</span>)

libs/common-docs/src/lib/demo-section-components/demo-examples-section/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export { ExamplesComponent } from './examples.component';
2020
CommonModule,
2121
NgApiDocModule,
2222
RouterModule,
23-
TabsModule.forRoot(),
23+
TabsModule,
2424
],
2525
exports: [
2626
ExamplesComponent,

libs/common-docs/src/lib/demo-section-components/demo-examples-section/stackblitz/app.module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import { ${className === 'DemoModalServiceFromComponent' ? `${className}, ModalC
2525
declarations: [${className === 'DemoModalServiceFromComponent' ? `${className}, ModalContentComponent` : className}],
2626
imports: [
2727
${moduleData.moduleName}.forRoot(),
28-
${className === 'DemoModalWithPopupsComponent' ? `TooltipModule.forRoot(),
29-
PopoverModule.forRoot(),` : ''}
28+
${className === 'DemoModalWithPopupsComponent' ? `TooltipModule,
29+
PopoverModule,` : ''}
3030
BrowserAnimationsModule,
3131
CommonModule,
3232
FormsModule,

libs/common-docs/src/lib/docs.module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ export { ThemesComponent } from './common/themes/themes.component';
7979
NgApiDocModule,
8080
ExamplesComponentModule,
8181
ApiSectionsComponentModule,
82-
TabsModule.forRoot(),
83-
BsDropdownModule.forRoot(),
82+
TabsModule,
83+
BsDropdownModule,
8484
RouterModule
8585
],
8686
exports: [

libs/doc-pages/accordion/src/lib/accordion.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export { AccordionSectionComponent } from './accordion-section.component';
1717
...DEMO_COMPONENTS
1818
],
1919
imports: [
20-
AccordionModule.forRoot(),
20+
AccordionModule,
2121
CommonModule,
2222
FormsModule,
2323
DocsModule,

libs/doc-pages/accordion/src/lib/docs/usage.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1+
### Standalone component usage
2+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
3+
4+
import { AccordionComponent, AccordionPanelComponent } from 'ngx-bootstrap/accordion';
5+
6+
@Component({
7+
standalone: true,
8+
imports: [
9+
BrowserAnimationsModule,
10+
AccordionComponent,
11+
AccordionPanelComponent
12+
...
13+
]
14+
})
15+
export class AppComponent(){}
16+
17+
Also should be added web-animations-js polyfill for IE browser (Edge)
18+
### Module usage
119
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
220

321
import { AccordionModule } from 'ngx-bootstrap/accordion';
422

523
@NgModule({
624
imports: [
725
BrowserAnimationsModule,
8-
AccordionModule.forRoot(),
26+
AccordionModule,
927
...
1028
]
1129
})

libs/doc-pages/alerts/src/lib/alerts.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export { AlertsSectionComponent } from './alerts-section.component';
1515
...DEMO_COMPONENTS
1616
],
1717
imports: [
18-
AlertModule.forRoot(),
18+
AlertModule,
1919
CommonModule,
2020
DocsModule,
2121
RouterModule.forChild(routes)
+12-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1+
### Standalone component usage
2+
import { AlertComponent } from 'ngx-bootstrap/alert';
3+
4+
@Components({
5+
standalone: true,
6+
imports: [AlertComponent,...]
7+
})
8+
export class AppComponent(){}
9+
10+
11+
### Module usage
112
import { AlertModule } from 'ngx-bootstrap/alert';
213

314
@NgModule({
4-
imports: [AlertModule.forRoot(),...]
15+
imports: [AlertModule,...]
516
})
617
export class AppModule(){}

libs/doc-pages/buttons/src/lib/buttons.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export { ButtonsSectionComponent } from './buttons-section.component';
2222
CommonModule,
2323
DocsModule,
2424
RouterModule.forChild(routes),
25-
ButtonsModule.forRoot()
25+
ButtonsModule
2626
],
2727
exports: [ButtonsSectionComponent]
2828
})
+14-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1+
### Standalone component usage
2+
import { ButtonsModule } from 'ngx-bootstrap/buttons';
3+
4+
@Component({
5+
imports: [
6+
ButtonsModule,
7+
...
8+
]
9+
})
10+
export class AppComponent(){}
11+
12+
13+
### Module usage
114
import { ButtonsModule } from 'ngx-bootstrap/buttons';
215

316
@NgModule({
4-
imports: [ButtonsModule.forRoot(),...]
17+
imports: [ButtonsModule,...]
518
})
619
export class AppModule(){}

libs/doc-pages/carousel/src/lib/carousel.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export { CarouselSectionComponent } from './carousel-section.component';
1616
...DEMO_COMPONENTS
1717
],
1818
imports: [
19-
CarouselModule.forRoot(),
19+
CarouselModule,
2020
CommonModule,
2121
FormsModule,
2222
DocsModule,
+14-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1+
### Standalone component usage
2+
import { CarouselModule } from 'ngx-bootstrap/carousel';
3+
4+
@Component({
5+
imports: [
6+
CarouselModule,
7+
...
8+
]
9+
})
10+
export class AppComponent(){}
11+
12+
13+
### Module usage
114
import { CarouselModule } from 'ngx-bootstrap/carousel';
215

316
@NgModule({
4-
imports: [CarouselModule.forRoot(),...]
17+
imports: [CarouselModule,...]
518
})
619
export class AppModule(){}

libs/doc-pages/collapse/src/lib/collapse.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export { CollapseSectionComponent } from './collapse-section.component';
1717
...DEMO_COMPONENTS
1818
],
1919
imports: [
20-
CollapseModule.forRoot(),
20+
CollapseModule,
2121
CommonModule,
2222
FormsModule,
2323
DocsModule,

libs/doc-pages/collapse/src/lib/docs/usage.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
### Standalone component usage
2+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
3+
4+
import { CollapseDirective } from 'ngx-bootstrap/collapse';
5+
6+
@Component({
7+
imports: [
8+
BrowserAnimationsModule,
9+
CollapseDirective,
10+
...
11+
]
12+
})
13+
export class AppComponent(){}
14+
15+
16+
### Module usage
117
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
218

319
import { CollapseModule } from 'ngx-bootstrap/collapse';
420

521
@NgModule({
622
imports: [
723
BrowserAnimationsModule,
8-
CollapseModule.forRoot(),
24+
CollapseModule,
925
...
1026
]
1127
})

libs/doc-pages/datepicker/src/lib/datepicker.module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ locales.forEach((locale: LocaleData) => {
4343
...DEMO_COMPONENTS
4444
],
4545
imports: [
46-
BsDatepickerModule.forRoot(),
47-
TabsModule.forRoot(),
46+
BsDatepickerModule,
47+
TabsModule,
4848
CommonModule,
4949
FormsModule,
5050
ReactiveFormsModule,

libs/doc-pages/datepicker/src/lib/demo-datepicker.module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ locales.forEach((locale: LocaleData) => {
4141
...DEMO_COMPONENTS
4242
],
4343
imports: [
44-
BsDatepickerModule.forRoot(),
45-
TabsModule.forRoot(),
44+
BsDatepickerModule,
45+
TabsModule,
4646
CommonModule,
4747
FormsModule,
4848
ReactiveFormsModule,

libs/doc-pages/datepicker/src/lib/docs/usage.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
### Standalone component usage
2+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
3+
4+
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
5+
6+
@Components({
7+
imports: [
8+
BrowserAnimationsModule,
9+
BsDatepickerModule,
10+
...
11+
]
12+
})
13+
export class AppComponents(){}
14+
15+
16+
### Module usage
117
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
218

319
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
420

521
@NgModule({
622
imports: [
723
BrowserAnimationsModule,
8-
BsDatepickerModule.forRoot(),
24+
BsDatepickerModule,
925
...
1026
]
1127
})

libs/doc-pages/dropdown/src/lib/docs/usage.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1+
### Standalone component usage
2+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
3+
4+
import { BsDropdownModule } from 'ngx-bootstrap/datepicker';
5+
6+
@Components({
7+
standalone: true,
8+
imports: [
9+
BrowserAnimationsModule,
10+
BsDropdownModule,
11+
...
12+
]
13+
})
14+
export class AppComponents(){}
15+
16+
17+
### Module usage
118
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
219

320
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
421

522
@NgModule({
623
imports: [
724
BrowserAnimationsModule,
8-
BsDropdownModule.forRoot()
25+
BsDropdownModule
926
]
1027
})
1128
export class AppModule(){}

libs/doc-pages/dropdown/src/lib/dropdown.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export { DropdownSectionComponent } from './dropdown-section.component';
1717
...DEMO_COMPONENTS
1818
],
1919
imports: [
20-
BsDropdownModule.forRoot(),
20+
BsDropdownModule,
2121
CommonModule,
2222
FormsModule,
2323
DocsModule,
+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
### Standalone component usage
2+
import { ModalModule, BsModalService } from 'ngx-bootstrap/modal';
3+
4+
@Component({
5+
standalone: true,
6+
imports: [ModalModule,...], // module can be optional
7+
providers: [BsModalService]
8+
})
9+
export class AppComponent(){}
10+
11+
### Module usage
112
import { ModalModule } from 'ngx-bootstrap/modal';
213

314
@NgModule({
4-
imports: [ModalModule.forRoot(),...]
15+
imports: [ModalModule,...],
16+
providers: [BsModalService]
517
})
618
export class AppModule(){}

libs/doc-pages/modal/src/lib/modal.module.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33
import { FormsModule } from '@angular/forms';
44
import { RouterModule } from '@angular/router';
5-
import { ModalModule } from 'ngx-bootstrap/modal';
5+
import { BsModalService, ModalModule } from 'ngx-bootstrap/modal';
66

77
import { DocsModule } from '@ngx-bootstrap-doc/docs';
88
import { ModalSectionComponent } from './modal-section.component';
@@ -24,14 +24,15 @@ export { ModalSectionComponent } from './modal-section.component';
2424
...DEMO_COMPONENTS
2525
],
2626
imports: [
27-
ModalModule.forRoot(),
28-
PopoverModule.forRoot(),
29-
TooltipModule.forRoot(),
27+
ModalModule,
28+
PopoverModule,
29+
TooltipModule,
3030
CommonModule,
3131
FormsModule,
3232
DocsModule,
3333
RouterModule.forChild(routes)
3434
],
35-
exports: [ModalSectionComponent]
35+
exports: [ModalSectionComponent],
36+
providers: [BsModalService]
3637
})
3738
export class DemoModalModule {}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
### Standalone component usage
2+
import { PaginationModule } from 'ngx-bootstrap/pagination';
3+
4+
@Component({
5+
standalone: true,
6+
imports: [PaginationModule,...],
7+
})
8+
export class AppComponent(){}
9+
10+
### Module usage
111
import { PaginationModule } from 'ngx-bootstrap/pagination';
212

313
@NgModule({
4-
imports: [PaginationModule.forRoot(),...]
14+
imports: [PaginationModule,...]
515
})
616
export class AppModule(){}

libs/doc-pages/pagination/src/lib/pagination.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export { PaginationSectionComponent } from './pagination-section.component';
1717
...DEMO_COMPONENTS
1818
],
1919
imports: [
20-
PaginationModule.forRoot(),
20+
PaginationModule,
2121
CommonModule,
2222
FormsModule,
2323
DocsModule,

0 commit comments

Comments
 (0)