mapcomplete/test.ts

26 lines
713 B
TypeScript
Raw Normal View History

2020-07-01 02:12:33 +02:00
import {Geocoding} from "./Logic/Geocoding";
import {SearchAndGo} from "./UI/SearchAndGo";
import {TextField} from "./UI/Base/TextField";
import {VariableUiElement} from "./UI/Base/VariableUIElement";
import {DropDownUI} from "./UI/Base/DropDownUI";
import {UIEventSource} from "./UI/UIEventSource";
2020-07-01 02:12:33 +02:00
console.log("HI");
var control = new UIEventSource<string>("b");
control.addCallback((data) => {
console.log("> GOT", control.data)
})
2020-07-01 02:12:33 +02:00
new DropDownUI("Test",
[{value: "a", shown: "a"},
{value: "b", shown: "b"},
{value: "c", shown: "c"},
], control
).AttachTo("maindiv");
2020-07-01 02:12:33 +02:00
new VariableUiElement(control).AttachTo("extradiv");
window.setTimeout(() => {control.setData("a")}, 1000);