mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge branch 'master'
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
<tc:TemplateView.template>
|
||||
<tc:TemplateView text="Click!" test="test" />
|
||||
</tc:TemplateView.template>
|
||||
</tc:TemplateView>
|
||||
</tc:TemplateView>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user