Skip to content

Commit 1cc0a89

Browse files
authored
feat: Angular 21 (#157)
1 parent 6bf94fc commit 1cc0a89

28 files changed

+8119
-7732
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ jobs:
2525
node-version: lts/*
2626
- uses: nrwl/nx-set-shas@v3
2727
- name: npm install
28-
run: npm install
28+
run: npm install --legacy-peer-deps
2929
- name: Build.all affected
3030
run: npx nx affected --target=build --exclude nativescript-demo-ng

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
/dist
44
/coverage
5+
packages/angular/dist
56

67
**/xplat/*/.xplatframework
78

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

apps/nativescript-demo-ng/project.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@
3838
"uglify": false,
3939
"release": false,
4040
"forDevice": false,
41-
"prepare": false,
42-
"flags": "--env.commonjs"
41+
"prepare": false
4342
},
44-
"dependsOn": ["^build"]
43+
"dependsOn": [
44+
"^build"
45+
]
4546
},
4647
"clean": {
4748
"executor": "@nativescript/nx:clean",
@@ -52,12 +53,16 @@
5253
},
5354
"test": {
5455
"executor": "@nativescript/nx:test",
55-
"outputs": ["{workspaceRoot}/coverage/apps/nativescript-demo-ng"],
56+
"outputs": [
57+
"{workspaceRoot}/coverage/apps/nativescript-demo-ng"
58+
],
5659
"options": {
57-
"coverage": false,
58-
"flags": "--env.commonjs"
60+
"coverage": false
5961
},
62+
"dependsOn": [
63+
"^build"
64+
],
6065
"configurations": {}
6166
}
6267
}
63-
}
68+
}

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

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<GridLayout rows="*" columns="*">
2-
<MDBottomNavigation selectedIndex="0" (loaded)="loadedTabView($event)" (selectedIndexChange)="onIndexChanged($event)">
2+
<MDBottomNavigation selectedIndex="0" (loaded)="loadedTabView()" (selectedIndexChange)="onIndexChanged($event)">
33
<MDTabStrip class="c-tabs">
44
<MDTabStripItem class="tabstripitem">
55
<Label [text]="tabItems?.start?.title" class="text-center text-sm"></Label>
@@ -13,3 +13,46 @@
1313
</MDTabContentItem>
1414
</MDBottomNavigation>
1515
</GridLayout>
16+
17+
18+
<!-- Uncomment to try core TabView features -->
19+
<!-- <TabView
20+
tabTextFontSize="11"
21+
iosTabBarMinimizeBehavior="onScrollDown"
22+
class="bg-black"
23+
>
24+
<GridLayout
25+
*tabItem="{
26+
title: 'Home',
27+
iconSource: 'sys://house.fill',
28+
}"
29+
>
30+
<Label text="Home Content" class="text-center text-white"></Label>
31+
</GridLayout>
32+
33+
<GridLayout
34+
*tabItem="{
35+
title: 'Saved',
36+
iconSource: 'sys://star.fill',
37+
}"
38+
>
39+
<Label text="Second Tab Content" class="text-center text-white"></Label>
40+
</GridLayout>
41+
42+
<GridLayout
43+
*tabItem="{
44+
title: 'Settings',
45+
iconSource: 'sys://gearshape.fill',
46+
}"
47+
>
48+
<Label text="Third Tab Content" class="text-center text-white"></Label>
49+
</GridLayout>
50+
<GridLayout
51+
*tabItem="{
52+
iconSource: 'res://ns-logo',
53+
role: 'search'
54+
}"
55+
>
56+
<Label text="Search Tab" class="text-center text-white"></Label>
57+
</GridLayout>
58+
</TabView> -->

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Component, inject, NgZone, NO_ERRORS_SCHEMA, OnInit } from '@angular/core';
22
import { ActivatedRoute, Router } from '@angular/router';
33
import { RouterExtensions, NativeScriptCommonModule } from '@nativescript/angular';
4-
import { Page, TabView } from '@nativescript/core';
4+
import { EventData, Page, TabView } from '@nativescript/core';
55

66
@Component({
77
selector: 'demo-home',
88
templateUrl: './home.component.html',
99
imports: [NativeScriptCommonModule],
10-
schemas: [NO_ERRORS_SCHEMA]
10+
schemas: [NO_ERRORS_SCHEMA],
1111
})
1212
export class HomeComponent implements OnInit {
1313
private _ngZone = inject(NgZone);
@@ -35,10 +35,6 @@ export class HomeComponent implements OnInit {
3535
}
3636
}
3737

38-
loadedTabView(args) {
39-
//
40-
}
41-
4238
private _viewTab(index: number) {
4339
let route;
4440
switch (index) {
@@ -61,7 +57,7 @@ export class HomeComponent implements OnInit {
6157
});
6258
}
6359

64-
private _initMenu(profilePic?: string) {
60+
private _initMenu() {
6561
for (let i = 0; i < this._tabs.length; i++) {
6662
const tab = this._tabs[i];
6763
// console.log('================')

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { NativeScriptCommonModule } from '@nativescript/angular';
1212
schemas: [NO_ERRORS_SCHEMA],
1313
})
1414
export class ItemDetailComponent implements OnInit {
15-
item: Item;
15+
item: Item | null = null;
1616
private itemService = inject(ItemService);
1717
private route = inject(ActivatedRoute);
1818

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import { ModalDialogService, NativeDialogService, NativeScriptCommonModule } fro
1313
schemas: [NO_ERRORS_SCHEMA],
1414
})
1515
export class ItemsComponent implements OnInit, OnDestroy {
16-
message = 'Hello Angular 20.0.0!';
17-
items: Array<Item>;
16+
message = 'Hello Angular 21.0.0!';
17+
items: Array<Item> = [];
1818
private itemService = inject(ItemService);
1919
private nativeDialog = inject(NativeDialogService);
2020
private modalDialog = inject(ModalDialogService);

apps/nativescript-demo-ng/src/app/item2/item-detail2.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<Label
1515
text="Congrats to the Angular Team!"
1616
textWrap="true"
17-
class="text-center mt-5 font-bold text-3xl text-blue-500"
17+
class="text-center mt-5 font-bold text-3xl text-blue-500 leading-3"
1818
></Label>
1919
<Label
2020
row="1"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export class ItemsComponent implements OnInit, OnDestroy {
2222
private nativeDialog = inject(NativeDialogService);
2323
private modalDialog = inject(ModalDialogService);
2424
private http = inject(HttpClient);
25-
message = 'Hello Angular 20.0.0';
26-
items: Array<Item>;
25+
message = 'Hello Angular 21.0.0';
26+
items: Array<Item> = [];
2727
borderRadius: number;
2828
fontSize: number;
2929

0 commit comments

Comments
 (0)