mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Issue number: Resolves #19484 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> The Angular implementation of `ion-tabs` does not support conditional binding the `slot` property on `ion-tab-bar` or assigning a variable as the slot. For example, this usage is invalid: ```html <ion-tabs> <ion-tab-bar [slot]="slot"></ion-tab-bar> </ion-tabs> ``` This occurs because `ng-content` only supports static content projection. It is not intended for scenarios where the content can be relocated or conditionally rendered. An example of static content projection would be: ```html <ion-tabs> <ion-tab-bar slot="top"></ion-tab-bar> </ion-tabs> ``` ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - `ion-tabs` supports conditional slot bindings or a slot that is bound to a variable in Angular. The revised implementation relocates the tab bar in the `ion-tabs` template, based on it's current slot attribute. The implementation checks the tab bar slot whenever the content changes. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Dev-build: `7.0.11-dev.11685631370.18980633` --------- Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
89 lines
4.2 KiB
TypeScript
89 lines
4.2 KiB
TypeScript
import { NgModule } from '@angular/core';
|
|
import { Routes, RouterModule } from '@angular/router';
|
|
import { InputsComponent } from './inputs/inputs.component';
|
|
import { ModalComponent } from './modal/modal.component';
|
|
import { RouterLinkComponent } from './router-link/router-link.component';
|
|
import { RouterLinkPageComponent } from './router-link-page/router-link-page.component';
|
|
import { RouterLinkPage2Component } from './router-link-page2/router-link-page2.component';
|
|
import { RouterLinkPage3Component } from './router-link-page3/router-link-page3.component';
|
|
import { HomePageComponent } from './home-page/home-page.component';
|
|
import { NestedOutletComponent } from './nested-outlet/nested-outlet.component';
|
|
import { NestedOutletPageComponent } from './nested-outlet-page/nested-outlet-page.component';
|
|
import { NestedOutletPage2Component } from './nested-outlet-page2/nested-outlet-page2.component';
|
|
import { ViewChildComponent } from './view-child/view-child.component';
|
|
import { ProvidersComponent } from './providers/providers.component';
|
|
import { FormComponent } from './form/form.component';
|
|
import { NavigationPage1Component } from './navigation-page1/navigation-page1.component';
|
|
import { NavigationPage2Component } from './navigation-page2/navigation-page2.component';
|
|
import { NavigationPage3Component } from './navigation-page3/navigation-page3.component';
|
|
import { AlertComponent } from './alert/alert.component';
|
|
import { AccordionComponent } from './accordion/accordion.component';
|
|
|
|
const routes: Routes = [
|
|
{ path: '', component: HomePageComponent },
|
|
{ path: 'version-test', loadChildren: () => import('./version-test').then(m => m.VersionTestModule) },
|
|
{ path: 'accordions', component: AccordionComponent },
|
|
{ path: 'alerts', component: AlertComponent },
|
|
{ path: 'inputs', component: InputsComponent },
|
|
{ path: 'textarea', loadChildren: () => import('./textarea/textarea.module').then(m => m.TextareaModule) },
|
|
{ path: 'searchbar', loadChildren: () => import('./searchbar/searchbar.module').then(m => m.SearchbarModule) },
|
|
{ path: 'form', component: FormComponent },
|
|
{ path: 'modals', component: ModalComponent },
|
|
{ path: 'modal-inline', loadChildren: () => import('./modal-inline').then(m => m.ModalInlineModule) },
|
|
{ path: 'view-child', component: ViewChildComponent },
|
|
{ path: 'keep-contents-mounted', loadChildren: () => import('./keep-contents-mounted').then(m => m.OverlayAutoMountModule) },
|
|
{ path: 'overlays-inline', loadChildren: () => import('./overlays-inline').then(m => m.OverlaysInlineModule) },
|
|
{ path: 'popover-inline', loadChildren: () => import('./popover-inline').then(m => m.PopoverInlineModule) },
|
|
{ path: 'providers', component: ProvidersComponent },
|
|
{ path: 'router-link', component: RouterLinkComponent },
|
|
{ path: 'router-link-page', component: RouterLinkPageComponent },
|
|
{ path: 'router-link-page2/:id', component: RouterLinkPage2Component },
|
|
{ path: 'router-link-page3', component: RouterLinkPage3Component },
|
|
{ path: 'standalone', loadComponent: () => import('./standalone/standalone.component').then(c => c.StandaloneComponent) },
|
|
{ path: 'tabs', redirectTo: '/tabs/account', pathMatch: 'full' },
|
|
{
|
|
path: 'navigation',
|
|
children: [
|
|
{ path: 'page1', component: NavigationPage1Component },
|
|
{ path: 'page2', component: NavigationPage2Component },
|
|
{ path: 'page3', component: NavigationPage3Component }
|
|
]
|
|
},
|
|
{
|
|
path: 'tabs',
|
|
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
|
|
},
|
|
{
|
|
path: 'tabs-global',
|
|
loadChildren: () => import('./tabs-global/tabs-global.module').then(m => m.TabsGlobalModule)
|
|
},
|
|
{
|
|
path: 'tabs-slots',
|
|
loadComponent: () => import('./tabs-slots.component').then(c => c.TabsSlotsComponent)
|
|
},
|
|
{
|
|
path: 'nested-outlet',
|
|
component: NestedOutletComponent,
|
|
children: [
|
|
{
|
|
path: 'page',
|
|
component: NestedOutletPageComponent
|
|
},
|
|
{
|
|
path: 'page2',
|
|
component: NestedOutletPage2Component
|
|
}
|
|
]
|
|
},
|
|
{
|
|
path: 'form-controls/range',
|
|
loadChildren: () => import('./form-controls/range/range.module').then(m => m.RangeModule)
|
|
}
|
|
];
|
|
|
|
@NgModule({
|
|
imports: [RouterModule.forRoot(routes)],
|
|
exports: [RouterModule]
|
|
})
|
|
export class AppRoutingModule { }
|