mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
custom component test removed from ui test app
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
.MyStackLayout {
|
||||
background-color: red;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import observable = require("data/observable");
|
||||
import stackLayoutModule = require("ui/layouts/stack-layout");
|
||||
import label = require("ui/label");
|
||||
import button = require("ui/button");
|
||||
|
||||
export class MyControl extends stackLayoutModule.StackLayout {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
var counter: number = 0;
|
||||
|
||||
var lbl = new label.Label();
|
||||
var btn = new button.Button();
|
||||
btn.text = "Tap me!";
|
||||
btn.on(button.Button.tapEvent, (args: observable.EventData) => {
|
||||
lbl.text = "Tap " + counter++;
|
||||
});
|
||||
|
||||
this.addChild(lbl);
|
||||
this.addChild(btn);
|
||||
|
||||
this.cssClass = "MyStackLayout";
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
{ "name" : "MyControl",
|
||||
"main" : "MyControl.js" }
|
||||
@@ -1,3 +0,0 @@
|
||||
.MySecondCustomStackLayout {
|
||||
background-color: green;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import observable = require("data/observable");
|
||||
import view = require("ui/core/view");
|
||||
import label = require("ui/label");
|
||||
|
||||
var count = 0;
|
||||
export function buttonTap2(args: observable.EventData) {
|
||||
count++;
|
||||
|
||||
var parent = (<view.View>args.object).parent;
|
||||
if (parent) {
|
||||
var lbl = parent.getViewById<label.Label>("Label1");
|
||||
if (lbl) {
|
||||
lbl.text = "You clicked " + count + " times!";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
<StackLayout xmlns:customControls="xml-declaration/mymodule" cssClass="MySecondCustomStackLayout">
|
||||
<Label id="Label1" text="mymodulewithxml" />
|
||||
<Button text="Click!" tap="buttonTap2" />
|
||||
</StackLayout>
|
||||
@@ -1,2 +0,0 @@
|
||||
{ "name" : "MyControl",
|
||||
"main" : "MyControl.js" }
|
||||
@@ -1,7 +0,0 @@
|
||||
<Page xmlns:customControls="custom-components/mymodule"
|
||||
xmlns:customControls2="custom-components/mymodulewithxml">
|
||||
<StackLayout>
|
||||
<customControls:MyControl />
|
||||
<customControls2:MyControl />
|
||||
</StackLayout>
|
||||
</Page>
|
||||
Reference in New Issue
Block a user