@@ -20,7 +20,8 @@ import { Component } from '@angular/core';
alt="">
- `
+ `,
+ standalone: true
})
export class BsTimepickerViewComponent {
ampm = 'ok';
diff --git a/src/datepicker/themes/bs/bs-years-calendar-view.component.ts b/src/datepicker/themes/bs/bs-years-calendar-view.component.ts
index 5b0a658c29..7641aeb478 100644
--- a/src/datepicker/themes/bs/bs-years-calendar-view.component.ts
+++ b/src/datepicker/themes/bs/bs-years-calendar-view.component.ts
@@ -8,10 +8,13 @@ import {
CellHoverEvent,
YearsCalendarViewModel
} from '../../models';
+import { NgFor } from '@angular/common';
+import { BsDatepickerNavigationViewComponent } from './bs-datepicker-navigation-view.component';
+import { BsCalendarLayoutComponent } from './bs-calendar-layout.component';
@Component({
- selector: 'bs-years-calendar-view',
- template: `
+ selector: 'bs-years-calendar-view',
+ template: `
- `
+ `,
+ standalone: true,
+ imports: [BsCalendarLayoutComponent, BsDatepickerNavigationViewComponent, NgFor]
})
export class BsYearsCalendarViewComponent {
@Input() calendar!: YearsCalendarViewModel;
diff --git a/src/dropdown/bs-dropdown-container.component.ts b/src/dropdown/bs-dropdown-container.component.ts
index e24ce958aa..ea8e5749a8 100644
--- a/src/dropdown/bs-dropdown-container.component.ts
+++ b/src/dropdown/bs-dropdown-container.component.ts
@@ -12,12 +12,15 @@ import { BsDropdownState } from './bs-dropdown.state';
import { dropdownAnimation } from './dropdown-animations';
import { AnimationBuilder, AnimationFactory } from '@angular/animations';
import { Subscription } from 'rxjs';
+import { NgClass } from '@angular/common';
// todo: revert ngClass to [class] when false positive angular-cli issue is fixed
// [class.dropdown]="direction === 'down'"-->
@Component({
selector: 'bs-dropdown-container',
changeDetection: ChangeDetectionStrategy.OnPush,
+ standalone: true,
+ imports: [NgClass],
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
host: {
style: 'display:block;position: absolute;z-index: 1040'
@@ -28,7 +31,8 @@ import { Subscription } from 'rxjs';
[class.show]="isOpen"
[class.open]="isOpen">
- `
+ `,
+ providers: [BsDropdownState]
})
export class BsDropdownContainerComponent implements OnDestroy {
isOpen = false;
diff --git a/src/dropdown/bs-dropdown-menu.directive.ts b/src/dropdown/bs-dropdown-menu.directive.ts
index 2fdc8898cd..5bc064e579 100644
--- a/src/dropdown/bs-dropdown-menu.directive.ts
+++ b/src/dropdown/bs-dropdown-menu.directive.ts
@@ -3,7 +3,8 @@ import { BsDropdownState } from './bs-dropdown.state';
@Directive({
selector: '[bsDropdownMenu],[dropdownMenu]',
- exportAs: 'bs-dropdown-menu'
+ exportAs: 'bs-dropdown-menu',
+ standalone: true
})
export class BsDropdownMenuDirective {
constructor(
diff --git a/src/dropdown/bs-dropdown-toggle.directive.ts b/src/dropdown/bs-dropdown-toggle.directive.ts
index a42ec9d076..68566d0e95 100644
--- a/src/dropdown/bs-dropdown-toggle.directive.ts
+++ b/src/dropdown/bs-dropdown-toggle.directive.ts
@@ -18,7 +18,8 @@ import { BsDropdownDirective } from './bs-dropdown.directive';
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
host: {
'[attr.aria-haspopup]': 'true'
- }
+ },
+ standalone: true
})
export class BsDropdownToggleDirective implements OnDestroy {
@HostBinding('attr.disabled') isDisabled: undefined | true;
diff --git a/src/dropdown/bs-dropdown.directive.ts b/src/dropdown/bs-dropdown.directive.ts
index e4bff6932e..dd6f4f3578 100644
--- a/src/dropdown/bs-dropdown.directive.ts
+++ b/src/dropdown/bs-dropdown.directive.ts
@@ -25,7 +25,8 @@ import { dropdownAnimation } from './dropdown-animations';
@Directive({
selector: '[bsDropdown], [dropdown]',
exportAs: 'bs-dropdown',
- providers: [BsDropdownState],
+ providers: [BsDropdownState, ComponentLoaderFactory, BsDropdownConfig],
+ standalone: true,
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
host: {
'[class.dropup]': 'dropup',
diff --git a/src/dropdown/bs-dropdown.module.ts b/src/dropdown/bs-dropdown.module.ts
index d7b0d8010a..5ab54af6fd 100644
--- a/src/dropdown/bs-dropdown.module.ts
+++ b/src/dropdown/bs-dropdown.module.ts
@@ -1,22 +1,17 @@
-import { CommonModule } from '@angular/common';
-import { ModuleWithProviders, NgModule } from '@angular/core';
-import { ComponentLoaderFactory } from 'ngx-bootstrap/component-loader';
+import { NgModule } from '@angular/core';
-import { PositioningService } from 'ngx-bootstrap/positioning';
import { BsDropdownContainerComponent } from './bs-dropdown-container.component';
import { BsDropdownMenuDirective } from './bs-dropdown-menu.directive';
import { BsDropdownToggleDirective } from './bs-dropdown-toggle.directive';
import { BsDropdownDirective } from './bs-dropdown.directive';
-import { BsDropdownState } from './bs-dropdown.state';
@NgModule({
- imports: [CommonModule],
- declarations: [
- BsDropdownMenuDirective,
- BsDropdownToggleDirective,
- BsDropdownContainerComponent,
- BsDropdownDirective
+ imports: [
+ BsDropdownDirective,
+ BsDropdownContainerComponent,
+ BsDropdownMenuDirective,
+ BsDropdownToggleDirective
],
exports: [
BsDropdownMenuDirective,
@@ -25,14 +20,8 @@ import { BsDropdownState } from './bs-dropdown.state';
]
})
export class BsDropdownModule {
- static forRoot(): ModuleWithProviders