Skip to content

Commit 00802d2

Browse files
authored
feat: Angular 19 support (#143)
1 parent 6c8a2b3 commit 00802d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3726
-4000
lines changed

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"useTabs": false,
3-
"printWidth": 600,
3+
"printWidth": 120,
44
"tabWidth": 2,
55
"singleQuote": true
66
}

apps/nativescript-demo-ng/.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ hooks/
33
node_modules/
44
platforms/
55

6-
# NativeScript Template
7-
*.js.map
8-
*.js
9-
!webpack.config.js
10-
!ngcc.config.js
11-
126
# Logs
137
logs
148
*.log

apps/nativescript-demo-ng/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"devDependencies": {
1010
"@nativescript/android": "~8.8.0",
1111
"@nativescript/ios": "~8.8.0",
12+
"@nativescript/tailwind": "^2.1.0",
1213
"@nativescript/unit-test-runner": "^3.0.1"
1314
}
1415
}

apps/nativescript-demo-ng/project.json

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -31,39 +31,20 @@
3131
}
3232
}
3333
},
34-
"ios": {
35-
"executor": "@nativescript/nx:build",
36-
"options": {
37-
"platform": "ios"
38-
},
39-
"configurations": {
40-
"build": {
41-
"copyTo": "./dist/build.ipa"
42-
},
43-
"prod": {
44-
"combineWithConfig": "build:prod"
45-
}
46-
}
47-
},
48-
"android": {
49-
"executor": "@nativescript/nx:build",
34+
"debug": {
35+
"executor": "@nativescript/nx:debug",
5036
"options": {
51-
"platform": "android"
37+
"noHmr": true,
38+
"uglify": false,
39+
"release": false,
40+
"forDevice": false,
41+
"prepare": false
5242
},
53-
"configurations": {
54-
"build": {
55-
"copyTo": "./dist/build.apk"
56-
},
57-
"prod": {
58-
"combineWithConfig": "build:prod"
59-
}
60-
}
43+
"dependsOn": ["^build"]
6144
},
6245
"clean": {
63-
"executor": "@nativescript/nx:build",
64-
"options": {
65-
"clean": true
66-
}
46+
"executor": "@nativescript/nx:clean",
47+
"options": {}
6748
},
6849
"lint": {
6950
"executor": "@nx/eslint:lint"
@@ -74,14 +55,7 @@
7455
"options": {
7556
"coverage": false
7657
},
77-
"configurations": {
78-
"android": {
79-
"platform": "android"
80-
},
81-
"ios": {
82-
"platform": "ios"
83-
}
84-
}
58+
"configurations": {}
8559
}
8660
}
8761
}

apps/nativescript-demo-ng/src/app.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ In many cases you may want to use the NativeScript core theme instead
99
of writing your own CSS rules. For a full list of class names in the theme
1010
refer to http://docs.nativescript.org/ui/theme.
1111
*/
12-
@import '@nativescript/theme/css/core.css';
13-
@import '@nativescript/theme/css/default.css';
12+
/* @import '@nativescript/theme/css/core.css';
13+
@import '@nativescript/theme/css/default.css'; */
14+
@tailwind base;
15+
@tailwind components;
16+
@tailwind utilities;
1417

1518
Button {
1619
border: 0;
@@ -23,11 +26,18 @@ Button {
2326
color: #fff;
2427
}
2528

26-
.h1 {
29+
.h-center {
30+
horizontal-align: center;
31+
}
32+
.h-right {
33+
horizontal-align: right;
34+
}
35+
36+
/* .h1 {
2737
font-weight: bold;
2838
margin: 10 0 0;
2939
}
3040
3141
.c-light-blue {
3242
color: #65ADF1;
33-
}
43+
} */

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import { Component, ViewContainerRef, OnInit, OnDestroy } from '@angular/core';
1+
import { Component, NO_ERRORS_SCHEMA, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
2+
import { PageRouterOutlet } from '@nativescript/angular';
23

34
// registerElement('ns-app', () => GridLayout);
45
@Component({
56
selector: 'ns-app',
67
moduleId: module.id,
78
templateUrl: './app.component.html',
9+
imports: [PageRouterOutlet],
10+
schemas: [NO_ERRORS_SCHEMA],
811
})
912
export class AppComponent implements OnInit, OnDestroy {
1013
constructor(private vcRef: ViewContainerRef) {}

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: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
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';
85
// import { BootGuardService } from './boot-guard.service';
96

10-
const routes: Routes = [
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 @@ 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/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<MDBottomNavigation selectedIndex="0" (loaded)="loadedTabView($event)" (selectedIndexChange)="onIndexChanged($event)">
33
<MDTabStrip class="c-tabs">
44
<MDTabStripItem class="tabstripitem">
5-
<Label [text]="tabItems?.start?.title" class="text-center t-12"></Label>
5+
<Label [text]="tabItems?.start?.title" class="text-center text-sm"></Label>
66
</MDTabStripItem>
77
</MDTabStrip>
88

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { Component, NgZone, OnInit } from '@angular/core';
22
import { ActivatedRoute, Router } from '@angular/router';
3-
import { RouterExtensions } from '@nativescript/angular';
3+
import { RouterExtensions, NativeScriptCommonModule } from '@nativescript/angular';
44
import { Page, TabView } from '@nativescript/core';
55

66
@Component({
77
moduleId: module.id,
88
selector: 'demo-home',
99
templateUrl: './home.component.html',
10+
imports: [NativeScriptCommonModule],
11+
standalone: true,
1012
})
1113
export class HomeComponent implements OnInit {
1214
tabItems: { [key: string]: { index: number; title?: string; iconSource?: string; textTransform?: string } } = {};

0 commit comments

Comments
 (0)