diff --git a/demo/src/app/components/+modal/demo-modal.module.ts b/demo/src/app/components/+modal/demo-modal.module.ts index 7fbef914a2..d4858a1cc9 100644 --- a/demo/src/app/components/+modal/demo-modal.module.ts +++ b/demo/src/app/components/+modal/demo-modal.module.ts @@ -9,6 +9,8 @@ import { ModalSectionComponent } from './modal-section.component'; import { DEMO_COMPONENTS } from './demos'; import { routes } from './demo-modal.routes'; import { ModalContentComponent } from './demos/service-component/service-component'; +import { PopoverModule } from 'ngx-bootstrap/popover'; +import { TooltipModule } from 'ngx-bootstrap/tooltip'; @NgModule({ declarations: [ @@ -18,6 +20,8 @@ import { ModalContentComponent } from './demos/service-component/service-compone ], imports: [ ModalModule.forRoot(), + PopoverModule.forRoot(), + TooltipModule.forRoot(), CommonModule, FormsModule, DocsModule, diff --git a/demo/src/app/components/+modal/demos/index.ts b/demo/src/app/components/+modal/demos/index.ts index 583937973b..1c90916e61 100644 --- a/demo/src/app/components/+modal/demos/index.ts +++ b/demo/src/app/components/+modal/demos/index.ts @@ -16,6 +16,7 @@ import { DemoModalServiceEventsComponent } from './service-events/service-events import { DemoModalServiceConfirmWindowComponent } from './service-confirm-window/service-confirm-window'; import { DemoModalScrollingLongContentComponent } from './scrolling-long-content/scrolling-long-content'; import { DemoAccessibilityComponent } from './accessibility/accessibility'; +import { DemoModalWithPopupsComponent } from './modal-with-popups/modal-with-popups'; export const DEMO_COMPONENTS = [ DemoModalSizesComponent, @@ -34,5 +35,6 @@ export const DEMO_COMPONENTS = [ DemoModalServiceEventsComponent, DemoModalServiceConfirmWindowComponent, DemoModalScrollingLongContentComponent, - DemoAccessibilityComponent + DemoAccessibilityComponent, + DemoModalWithPopupsComponent ]; diff --git a/demo/src/app/components/+modal/demos/modal-with-popups/modal-with-popups.html b/demo/src/app/components/+modal/demos/modal-with-popups/modal-with-popups.html new file mode 100644 index 0000000000..f32a47dfd2 --- /dev/null +++ b/demo/src/app/components/+modal/demos/modal-with-popups/modal-with-popups.html @@ -0,0 +1,15 @@ + + + + + diff --git a/demo/src/app/components/+modal/demos/modal-with-popups/modal-with-popups.ts b/demo/src/app/components/+modal/demos/modal-with-popups/modal-with-popups.ts new file mode 100644 index 0000000000..13d7948871 --- /dev/null +++ b/demo/src/app/components/+modal/demos/modal-with-popups/modal-with-popups.ts @@ -0,0 +1,16 @@ +import { Component, TemplateRef } from '@angular/core'; +import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal'; + +@Component({ + selector: 'demo-modal-with-popups', + templateUrl: './modal-with-popups.html' +}) +export class DemoModalWithPopupsComponent { + modalRef: BsModalRef; + + constructor(private modalService: BsModalService) {} + + openModal(template: TemplateRef) { + this.modalRef = this.modalService.show(template); + } +} diff --git a/demo/src/app/components/+modal/modal-section.list.ts b/demo/src/app/components/+modal/modal-section.list.ts index e2bd22a678..4664164478 100644 --- a/demo/src/app/components/+modal/modal-section.list.ts +++ b/demo/src/app/components/+modal/modal-section.list.ts @@ -15,6 +15,7 @@ import { DemoModalNestedComponent } from './demos/nested/nested'; import { DemoModalEventsComponent } from './demos/events/events'; import { DemoAutoShownModalComponent } from './demos/auto-shown/auto-shown'; import { DemoAccessibilityComponent } from './demos/accessibility/accessibility'; +import { DemoModalWithPopupsComponent } from './demos/modal-with-popups/modal-with-popups'; import { ContentSection } from '../../docs/models/content-section.model'; import { DemoTopSectionComponent } from '../../docs/demo-section-components/demo-top-section/index'; @@ -130,6 +131,14 @@ export const demoComponentContent: ContentSection[] = [ description: `

There is closing by Esc button option that you can configure.

`, outlet: DemoModalServiceDisableEscClosingComponent }, + { + title: 'Modal window with tooltip and popover', + anchor: 'modal-with-popups', + component: require('!!raw-loader?lang=typescript!./demos/modal-with-popups/modal-with-popups.ts'), + html: require('!!raw-loader?lang=markup!./demos/modal-with-popups/modal-with-popups.html'), + description: `

Tooltips and popovers can be placed within modals as needed. When modals are closed, any tooltips and popovers within are also automatically dismissed.

`, + outlet: DemoModalWithPopupsComponent + }, { title: 'Backdrop options', anchor: 'service-disable-backdrop',