Merge branch 'master'

This commit is contained in:
Vasil Trifonov
2020-01-17 15:12:28 +02:00
parent 432a029499
commit b76893801d
3131 changed files with 418263 additions and 185769 deletions

View File

@@ -2,4 +2,4 @@
<tc:TemplateView.template>
<tc:TemplateView text="Click!" test="test" />
</tc:TemplateView.template>
</tc:TemplateView>
</tc:TemplateView>

View File

@@ -1,2 +1,11 @@
// Our unit test will set this function and expect it to be set as a handler on a View in the XML.
export var test: (args: any) => void;
let callback: (args: any) => void;
export function test(args: any) {
if (callback) {
callback(args);
}
}
export function setCallback(cb: (args: any) => void) {
callback = cb;
}

View File

@@ -1,2 +1,4 @@
// Our unit test will set this function and expect it to be set as a handler on a View in the XML.
export var test: (args: any) => void;
export interface ITestEvent {
test: (args: any) => void;
}

View File

@@ -1,6 +1,6 @@
import { Property } from "tns-core-modules/ui/core/properties"
import { LayoutBase } from "tns-core-modules/ui/layouts/layout-base"
import { parse } from "tns-core-modules/ui/builder"
import { Property } from "@nativescript/core/ui/core/properties";
import { LayoutBase } from "@nativescript/core/ui/layouts/layout-base";
import { Builder } from "@nativescript/core/ui/builder";
export module knownTemplates {
export var template = "template";
@@ -10,14 +10,14 @@ export class TemplateView extends LayoutBase {
public template: string;
public static testEvent: string = "test";
public parseTemplate() {
this.addChild(parse(this.template));
this.addChild(Builder.parse(this.template));
}
}
export const templateProperty = new Property<TemplateView, string>({
name: "template",
affectsLayout: true
});
name: "template",
affectsLayout: true
});
templateProperty.register(TemplateView);