Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: demo wip
  • Loading branch information
NathanWalker committed Dec 8, 2025
commit 8c1467f5f37de7ec9d9e96237ba498f42229eb0a
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<ActionBar title="SplitView Demo"></ActionBar>

<GridLayout rows="*, *" columns="*">
<SplitView
row="0"
displayMode="twoBesideSecondary"
splitBehavior="tile"
preferredPrimaryColumnWidthFraction="0.25"
preferredSupplementaryColumnWidthFraction="0.33"
preferredInspectorColumnWidthFraction="0.2"
>
<page-router-outlet name="primary"></page-router-outlet>
<page-router-outlet name="secondary"></page-router-outlet>
<page-router-outlet name="supplementary"></page-router-outlet>
<page-router-outlet name="inspector"></page-router-outlet>
</SplitView>
</GridLayout>
<SplitView
displayMode="twoBesideSecondary"
splitBehavior="tile"
preferredPrimaryColumnWidthFraction="0.25"
preferredSupplementaryColumnWidthFraction="0.33"
preferredInspectorColumnWidthFraction="0.2"
>
<page-router-outlet name="primary"></page-router-outlet>
<page-router-outlet name="secondary"></page-router-outlet>
<page-router-outlet name="supplementary"></page-router-outlet>
<page-router-outlet name="inspector"></page-router-outlet>
</SplitView>
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
import { Component, inject, NO_ERRORS_SCHEMA, OnInit } from '@angular/core';
import {
NativeScriptCommonModule,
NativeScriptRouterModule,
PageRouterOutlet,
RouterExtensions,
} from '@nativescript/angular';

@Component({
selector: 'ns-split-view-demo',
templateUrl: './split-view-demo.component.html',
imports: [NativeScriptCommonModule, NativeScriptRouterModule],
standalone: true,
imports: [NativeScriptCommonModule, NativeScriptRouterModule, PageRouterOutlet],
schemas: [NO_ERRORS_SCHEMA],
})
export class SplitViewDemoComponent {}
export class SplitViewDemoComponent implements OnInit {
router = inject(RouterExtensions);

ngOnInit() {
this.router.navigate(
[
'/',
{
outlets: {
primary: ['primary'],
secondary: ['secondary'],
supplementary: ['supplementary'],
inspector: ['inspector'],
},
},
],
{ animated: false },
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { NativeScriptCommonModule } from '@nativescript/angular';
<Label row="0" text="Inspector" class="h2 mb-8"></Label>
<Label row="1" text="This is the inspector column." class="text-center"></Label>
</GridLayout>`,
standalone: true,
imports: [NativeScriptCommonModule],
schemas: [NO_ERRORS_SCHEMA],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { NativeScriptCommonModule } from '@nativescript/angular';
<Label row="0" text="Primary" class="h2 mb-8"></Label>
<Label row="1" text="This is the primary column." class="text-center"></Label>
</GridLayout>`,
standalone: true,
imports: [NativeScriptCommonModule],
schemas: [NO_ERRORS_SCHEMA],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { NativeScriptCommonModule } from '@nativescript/angular';
<Label row="0" text="Secondary" class="h2 mb-8"></Label>
<Label row="1" text="This is the secondary column." class="text-center"></Label>
</GridLayout>`,
standalone: true,
imports: [NativeScriptCommonModule],
schemas: [NO_ERRORS_SCHEMA],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { NativeScriptCommonModule } from '@nativescript/angular';
<Label row="0" text="Supplementary" class="h2 mb-8"></Label>
<Label row="1" text="This is the supplementary column." class="text-center"></Label>
</GridLayout>`,
standalone: true,
imports: [NativeScriptCommonModule],
schemas: [NO_ERRORS_SCHEMA],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export const SPLIT_VIEW_ROUTES: Routes = [
path: '',
component: SplitViewDemoComponent,
children: [
{
path: '',
redirectTo: '/split-view-demo/(primary:primary//secondary:secondary//supplementary:supplementary//inspector:inspector)',
pathMatch: 'full',
},
// {
// path: '',
// redirectTo: '/(primary:primary//secondary:secondary//supplementary:supplementary//inspector:inspector)',
// pathMatch: 'full',
// },
{
path: 'primary',
component: SplitViewPrimaryComponent,
Expand Down
10 changes: 6 additions & 4 deletions apps/nativescript-demo-ng/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import { Trace, Utils } from '@nativescript/core';

// import { AppModule } from './app/app.module';
import { withInterceptorsFromDi } from '@angular/common/http';
import { AppComponent } from './app/app.component';
import { routes } from './app/app.routes';
// import { AppComponent } from './app/app.component';
// import { routes } from './app/app.routes';
import { provideZonelessChangeDetection } from '@angular/core';
import { SPLIT_VIEW_ROUTES } from './app/split-view-demo/split-view.routes';
import { SplitViewDemoComponent } from './app/split-view-demo/split-view-demo.component';

const ZONELESS = true;

Expand All @@ -23,10 +25,10 @@ runNativeScriptAngularApp({
if (__APPLE__) {
Utils.ios.setWindowBackgroundColor('#a6120d');
}
return bootstrapApplication(AppComponent, {
return bootstrapApplication(SplitViewDemoComponent, {
providers: [
provideNativeScriptHttpClient(withInterceptorsFromDi()),
provideNativeScriptRouter(routes),
provideNativeScriptRouter(SPLIT_VIEW_ROUTES),
ZONELESS ? provideZonelessChangeDetection() : provideNativeScriptNgZone(),
],
});
Expand Down