mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 13:51:27 +08:00

* chore(tslint): fix tslint config & errors * chore(tslint): enable double quotes, whitespace, and arrow-return-shorthand rules and fix errors
19 lines
588 B
TypeScript
19 lines
588 B
TypeScript
import { TextField } from "tns-core-modules/ui/text-field";
|
|
import { TextView } from "tns-core-modules/ui/text-view";
|
|
|
|
export function onLoaded(args) {
|
|
const page = args.object;
|
|
const textField = <TextField>page.getViewById("textField");
|
|
const textView = <TextView>page.getViewById("textView");
|
|
|
|
attachToEvent(textField, "blur");
|
|
attachToEvent(textField, "focus");
|
|
attachToEvent(textView, "blur");
|
|
attachToEvent(textView, "focus");
|
|
}
|
|
|
|
function attachToEvent(control, event) {
|
|
control.on(event, () => {
|
|
control.text = event + " is thrown";
|
|
});
|
|
} |