mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: TypeScript 5.1 with Nx 16.6 migrations (#10338)
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"main": "lifecycle-tests"
|
||||
"main": "lifecycle-tests"
|
||||
}
|
||||
|
||||
@@ -474,15 +474,15 @@ export var test_RepeaterItemsGestureBindings = function () {
|
||||
helper.navigateToModuleAndRunTest('ui/repeater/repeaterItems-bindingToGestures-page', null, testFunc);
|
||||
};
|
||||
|
||||
export var test_RepeaterItemsParentBindingsShouldWork = function () {
|
||||
export var test_RepeaterItemsBindingsShouldWork = function () {
|
||||
var testFunc = function (page: Page) {
|
||||
var repeater = <Repeater>page.getViewById('repeater');
|
||||
var expectedText = page.bindingContext['parentViewProperty'];
|
||||
var testPass = false;
|
||||
var expectedText = page.bindingContext['items'];
|
||||
var testPass: string;
|
||||
var eachChildCallback = function (childItem: View) {
|
||||
if (childItem instanceof Label) {
|
||||
testPass = (<Label>childItem).text === expectedText;
|
||||
if (testPass === false) {
|
||||
testPass = (<Label>childItem).text;
|
||||
if (!testPass) {
|
||||
return false;
|
||||
}
|
||||
} else if (childItem instanceof LayoutBase) {
|
||||
@@ -494,7 +494,7 @@ export var test_RepeaterItemsParentBindingsShouldWork = function () {
|
||||
|
||||
repeater.eachChildView(eachChildCallback);
|
||||
|
||||
TKUnit.assertEqual(testPass, true, 'Every item should have text bound to Page binding context!');
|
||||
TKUnit.assertEqual(!!testPass, true, 'Every item should have text bound to binding context!');
|
||||
};
|
||||
|
||||
helper.navigateToModuleAndRunTest('ui/repeater/repeaterItems-bindingToGestures-page', null, testFunc);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function pageLoaded(args) {
|
||||
export function pageLoaded(args) {
|
||||
var page = args.object;
|
||||
page.bindingContext = {
|
||||
items: [
|
||||
@@ -18,8 +18,3 @@ function pageLoaded(args) {
|
||||
parentViewProperty: 'Parent View Property',
|
||||
};
|
||||
}
|
||||
exports.pageLoaded = pageLoaded;
|
||||
|
||||
exports.tapPage = function (args) {
|
||||
console.log('Tap! ' + args + ' ' + args.object);
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded">
|
||||
<Repeater id="repeater" items="{{ items }}">
|
||||
<Repeater.itemTemplate>
|
||||
<GridLayout width="94" height="94" >
|
||||
<Label text="{{ $parents['Page'].parentViewProperty }}" tap="{{ tapItem }}" />
|
||||
<GridLayout width="94" height="94">
|
||||
<Label text="{{ text }}" tap="{{ tapItem }}" />
|
||||
</GridLayout>
|
||||
</Repeater.itemTemplate>
|
||||
</Repeater>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"name": "MyControl",
|
||||
"main": "MyControl.js"
|
||||
"name": "MyControl",
|
||||
"main": "MyControl.js"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user