Skip to content

Commit bff2380

Browse files
committed
feat: added control flow syntax example
1 parent 308b3b5 commit bff2380

File tree

7 files changed

+12
-15
lines changed

7 files changed

+12
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @nativescript/angular
22

3-
For usage with NativeScript for Angular 12, 13, 14+ projects.
3+
For usage with NativeScript for Angular projects.
44

55
Clean and setup workspace:
66

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { ModalDialogService, NativeDialogService } from '@nativescript/angular';
1212
templateUrl: './items.component.html',
1313
})
1414
export class ItemsComponent implements OnInit {
15-
message = 'Hello Angular 17...rc';
15+
message = 'Hello Angular 17';
1616
items: Array<Item>;
1717
borderRadius: number;
1818
fontSize: number;
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<GridLayout [backgroundColor]="color" rows="*,auto,auto" padding="20" width="100%" height="100%">
22
<Image [src]="logo" stretch="aspectFit" width="200" marginTop="50" />
3-
4-
<Button row="1" (tap)="openNewModal()" text="Taste Another" fontSize="20" borderRadius="25"></Button>
3+
4+
@if (this.itemService.currentFlavor + 1 !== this.itemService.flavors.length) {
5+
<Button row="1" (tap)="openNewModal()" text="Taste Another" fontSize="20" borderRadius="25"></Button>
6+
}
57
<Button row="2" [nativeDialogClose]="'thanks for clicking modal ' + id" text="Close" fontSize="20" marginTop="30" borderRadius="25"></Button>
68
</GridLayout>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ export class ModalComponent implements OnInit, OnDestroy {
2424

2525
openNewModal() {
2626
this.itemService.currentFlavor++;
27-
this.nativeDialog.open(ModalComponent, {
27+
const ref = this.nativeDialog.open(ModalComponent, {
2828
nativeOptions: {
2929
fullscreen: !!global.isAndroid,
3030
},
3131
});
32-
// this.modalDialog.showModal(ModalComponent, {
33-
// viewContainerRef: this.vcRef
34-
// });
32+
ref.afterClosed().subscribe(() => {
33+
this.itemService.currentFlavor--;
34+
});
3535
}
3636
ngOnInit() {
3737
console.log('modal init');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"@nativescript/types": "~8.6.0",
6363
"@nativescript/unit-test-runner": "^3.0.4",
6464
"@nativescript/webpack": "~5.0.12",
65-
"@ngtools/webpack": "17.0.0-rc.3",
65+
"@ngtools/webpack": "17.0.0",
6666
"@nstudio/angular": "17.0.1",
6767
"@nstudio/nativescript": "17.0.1",
6868
"@nstudio/nativescript-angular": "17.0.1",

packages/angular/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# @nativescript/angular
22

3-
For usage with NativeScript for Angular 12+ (13, etc.) projects.
3+
For usage with NativeScript for Angular projects.

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,11 +2256,6 @@
22562256
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-17.0.0.tgz#358382da755b781ad8a576e398f94f7ac27d669a"
22572257
integrity sha512-/Bb5MXlphNp3UDsQDa4EB4AwpF4D/plrCPd5YGfVvD43j5g5Rpen+cqz5jai1zfAkF1dPl2qq0nRp/jwmJO3uA==
22582258

2259-
"@ngtools/[email protected]":
2260-
version "17.0.0-rc.3"
2261-
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-17.0.0-rc.3.tgz#75bfa534307b48f6d67f1e7aeec24127c13902ee"
2262-
integrity sha512-jNj1riYrF7Qwq4tD5FqWTVI3SlERWy01iLN8Hmx2i1b7IeSHm6UY6g1DSTgV7PuMesFMumORPtSc9WqCcPAPIg==
2263-
22642259
"@ngx-translate/core@~15.0.0":
22652260
version "15.0.0"
22662261
resolved "https://registry.yarnpkg.com/@ngx-translate/core/-/core-15.0.0.tgz#0fe55b9bd47e75b03d1123658f15fb7b5a534f3c"

0 commit comments

Comments
 (0)