Last active
January 25, 2017 07:37
-
-
Save EddyVerbruggen/3dde6d0b4259f6b685350b43b3d45090 to your computer and use it in GitHub Desktop.
NativeScript-Angular propertyChange examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wantEmailReceiptChanged(args: PropertyChangeData): void { | |
if (!args || args.propertyName !== "checked") { | |
return; | |
} | |
if (args.value) { | |
// switched on | |
} else { | |
// switched off | |
} | |
} | |
amountReceivedChanged(args: PropertyChangeData): void { | |
if (!args || args.value === "number" /* keyboardType property */) { | |
return; | |
} | |
let enteredAmount: string = "" + args.value; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Switch [(ngModel)]="wantsEmailReceipt" (propertyChange)="wantEmailReceiptChanged($event)"></Switch> | |
<TextField #amountReceivedField (propertyChange)="amountReceivedChanged($event)" keyboardType="number"></TextField> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment