Skip to content

Commit 8e0dcd3

Browse files
committed
feat: migrate to more modern style
1 parent 8e5efdf commit 8e0dcd3

File tree

7 files changed

+8
-74
lines changed

7 files changed

+8
-74
lines changed

apps/nativescript-demo-ng/src/app/app.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { Component, ViewContainerRef, OnInit, OnDestroy, NO_ERRORS_SCHEMA } from '@angular/core';
2-
import { NativeDialogModule, NativeScriptHttpClientModule, PageRouterOutlet } from '@nativescript/angular';
3-
import { AppRoutingModule } from './app-routing.module';
1+
import { Component, NO_ERRORS_SCHEMA, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
2+
import { PageRouterOutlet } from '@nativescript/angular';
43

54
// registerElement('ns-app', () => GridLayout);
65
@Component({

apps/nativescript-demo-ng/src/app/app.module.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

apps/nativescript-demo-ng/src/app/app-routing.module.ts renamed to apps/nativescript-demo-ng/src/app/app.routes.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import { NgModule } from '@angular/core';
21
import { Routes } from '@angular/router';
3-
import { NativeScriptRouterModule } from '@nativescript/angular';
4-
52
import { ItemDetailComponent } from './item/item-detail.component';
63
import { ItemsComponent } from './item/items.component';
74
// import { HomeComponent } from './home/home.component';
@@ -11,7 +8,7 @@ export const routes: Routes = [
118
{ path: '', redirectTo: '/rootlazy', pathMatch: 'full' },
129
{ path: 'items', component: ItemsComponent },
1310
{ path: 'item/:id', component: ItemDetailComponent },
14-
{ path: 'item2', loadChildren: () => import('./item2/item2.module').then((m) => m.Item2Module) },
11+
{ path: 'item2', loadChildren: () => import('./item2/item2.routes').then((m) => m.ITEM2_ROUTES) },
1512
{ path: 'rootlazy', loadChildren: () => import('./item3/item3.module').then((m) => m.Item3Module) },
1613

1714
/**
@@ -36,9 +33,3 @@ export const routes: Routes = [
3633
// loadChildren: () => import('./item2/item2.module').then((m) => m.Item2Module),
3734
// },
3835
];
39-
40-
@NgModule({
41-
imports: [NativeScriptRouterModule.forRoot(routes)],
42-
exports: [NativeScriptRouterModule],
43-
})
44-
export class AppRoutingModule {}

apps/nativescript-demo-ng/src/app/item2/item2-routing.module.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

apps/nativescript-demo-ng/src/app/item2/item2.module.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { Routes } from '@angular/router';
2+
import { ItemDetailComponent } from './item-detail2.component';
3+
4+
export const ITEM2_ROUTES: Routes = [{ path: ':id', component: ItemDetailComponent }];

apps/nativescript-demo-ng/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Trace } from '@nativescript/core';
1212
import { withInterceptorsFromDi } from '@angular/common/http';
1313
import { importProvidersFrom } from '@angular/core';
1414
import { setWindowBackgroundColor } from '@nativescript/core/utils/ios';
15-
import { routes } from './app/app-routing.module';
15+
import { routes } from './app/app.routes';
1616
import { AppComponent } from './app/app.component';
1717

1818
Trace.enable();

0 commit comments

Comments
 (0)