Skip to content

Instantly share code, notes, and snippets.

@EddyVerbruggen
Last active January 25, 2017 07:37
Show Gist options
  • Save EddyVerbruggen/3dde6d0b4259f6b685350b43b3d45090 to your computer and use it in GitHub Desktop.
Save EddyVerbruggen/3dde6d0b4259f6b685350b43b3d45090 to your computer and use it in GitHub Desktop.
NativeScript-Angular propertyChange examples
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;
}
<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