mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(angular): add standalone modal (#27885)
This commit is contained in:
@@ -7,6 +7,7 @@ export const routes: Routes = [
|
||||
component: AppComponent,
|
||||
children: [
|
||||
{ path: 'test', loadComponent: () => import('../test/test.component').then(m => m.TestComponent) },
|
||||
{ path: 'modal', loadComponent: () => import('../modal/modal.component').then(m => m.ModalComponent) },
|
||||
{ path: 'router-outlet', loadComponent: () => import('../router-outlet/router-outlet.component').then(m => m.RouterOutletComponent) },
|
||||
{ path: 'back-button', loadComponent: () => import('../back-button/back-button.component').then(m => m.BackButtonComponent) },
|
||||
]
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<button id="open-modal">Open Modal</button>
|
||||
|
||||
<ion-modal trigger="open-modal">
|
||||
<ng-template>
|
||||
<div class="ion-padding" id="modal-content">This is my modal content</div>
|
||||
</ng-template>
|
||||
</ion-modal>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { IonModal } from '@ionic/angular/standalone';
|
||||
|
||||
@Component({
|
||||
selector: 'app-test',
|
||||
templateUrl: './modal.component.html',
|
||||
standalone: true,
|
||||
imports: [IonModal]
|
||||
})
|
||||
export class ModalComponent {
|
||||
}
|
||||
Reference in New Issue
Block a user