Skip to content

Commit 9da4fa7

Browse files
committed
feat: Angular 19
1 parent 84fca22 commit 9da4fa7

23 files changed

+168
-171
lines changed

packages/template-blank-ng/package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "src/main.ts",
44
"displayName": "Blank",
55
"templateType": "App template",
6-
"version": "8.8.2",
6+
"version": "8.8.3",
77
"description": "Blank template for NativeScript apps using Angular",
88
"author": "NativeScript Team <[email protected]>",
99
"license": "Apache-2.0",
@@ -39,26 +39,26 @@
3939
"url": "https://github.com/NativeScript/NativeScript/issues"
4040
},
4141
"dependencies": {
42-
"@angular/animations": "~18.0.0",
43-
"@angular/common": "~18.0.0",
44-
"@angular/compiler": "~18.0.0",
45-
"@angular/core": "~18.0.0",
46-
"@angular/forms": "~18.0.0",
47-
"@angular/platform-browser": "~18.0.0",
48-
"@angular/platform-browser-dynamic": "~18.0.0",
49-
"@angular/router": "~18.0.0",
50-
"@nativescript/angular": "^18.0.0",
42+
"@angular/animations": "~19.0.0",
43+
"@angular/common": "~19.0.0",
44+
"@angular/compiler": "~19.0.0",
45+
"@angular/core": "~19.0.0",
46+
"@angular/forms": "~19.0.0",
47+
"@angular/platform-browser": "~19.0.0",
48+
"@angular/platform-browser-dynamic": "~19.0.0",
49+
"@angular/router": "~19.0.0",
50+
"@nativescript/angular": "^19.0.0",
5151
"@nativescript/core": "~8.8.0",
5252
"@nativescript/theme": "^3.1.0",
5353
"rxjs": "~7.8.0",
54-
"zone.js": "~0.14.0"
54+
"zone.js": "~0.15.0"
5555
},
5656
"devDependencies": {
57-
"@angular-devkit/build-angular": "~18.0.0",
58-
"@angular/compiler-cli": "~18.0.0",
57+
"@angular-devkit/build-angular": "~19.0.0",
58+
"@angular/compiler-cli": "~19.0.0",
5959
"@nativescript/types": "~8.8.0",
6060
"@nativescript/webpack": "~5.0.0",
61-
"@ngtools/webpack": "~18.0.0",
62-
"typescript": "~5.4.0"
61+
"@ngtools/webpack": "~19.0.0",
62+
"typescript": "~5.6.0"
6363
}
6464
}

packages/template-blank-ng/src/app/app-routing.module.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import { Component } from '@angular/core'
1+
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
2+
import { PageRouterOutlet } from '@nativescript/angular';
23

34
@Component({
45
selector: 'ns-app',
5-
templateUrl: 'app.component.html',
6+
templateUrl: './app.component.html',
7+
imports: [PageRouterOutlet],
8+
schemas: [NO_ERRORS_SCHEMA],
69
})
710
export class AppComponent {}

packages/template-blank-ng/src/app/app.module.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { Routes } from '@angular/router';
2+
3+
export const routes: Routes = [
4+
{ path: '', redirectTo: '/home', pathMatch: 'full' },
5+
{ path: 'home', loadComponent: () => import('./home/home.component').then(m => m.HomeComponent) },
6+
];

packages/template-blank-ng/src/app/home/home-routing.module.ts

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

packages/template-blank-ng/src/app/home/home.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44

55
<GridLayout>
66
<!-- Add your page content here -->
7+
<Label text="Hello"></Label>
78
</GridLayout>
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { Component, OnInit } from '@angular/core'
1+
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
2+
import {
3+
NativeScriptCommonModule,
4+
NativeScriptRouterModule,
5+
} from '@nativescript/angular';
26

37
@Component({
48
selector: 'Home',
59
templateUrl: './home.component.html',
10+
imports: [NativeScriptCommonModule, NativeScriptRouterModule],
11+
schemas: [NO_ERRORS_SCHEMA],
612
})
7-
export class HomeComponent implements OnInit {
8-
constructor() {
9-
// Use the component constructor to inject providers.
10-
}
13+
export class HomeComponent {
1114

12-
ngOnInit(): void {
13-
// Init your component properties here.
14-
}
1515
}

packages/template-blank-ng/src/app/home/home.module.ts

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

packages/template-blank-ng/src/main.ts

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
1-
import { platformNativeScript, runNativeScriptAngularApp } from '@nativescript/angular';
1+
import {
2+
bootstrapApplication,
3+
provideNativeScriptHttpClient,
4+
provideNativeScriptNgZone,
5+
provideNativeScriptRouter,
6+
runNativeScriptAngularApp,
7+
} from '@nativescript/angular';
8+
import { provideExperimentalZonelessChangeDetection } from '@angular/core';
9+
import { withInterceptorsFromDi } from '@angular/common/http';
10+
import { routes } from './app/app.routes';
11+
import { AppComponent } from './app/app.component';
212

3-
import { AppModule } from './app/app.module';
13+
/**
14+
* Disable zone by setting this to true
15+
* Then also adjust polyfills.ts (see note there)
16+
*/
17+
const EXPERIMENTAL_ZONELESS = false;
418

519
runNativeScriptAngularApp({
6-
appModuleBootstrap: () => platformNativeScript().bootstrapModule(AppModule),
20+
appModuleBootstrap: () => {
21+
return bootstrapApplication(AppComponent, {
22+
providers: [
23+
provideNativeScriptHttpClient(withInterceptorsFromDi()),
24+
provideNativeScriptRouter(routes),
25+
EXPERIMENTAL_ZONELESS
26+
? provideExperimentalZonelessChangeDetection()
27+
: provideNativeScriptNgZone(),
28+
],
29+
});
30+
},
731
});
8-

0 commit comments

Comments
 (0)