Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- CLI: 5.4.0
- Cross-platform modules: 5.4.0
Describe the bug
Code-only custom components do not work with bundle workflow. NOTE: seems the issue is TypeScript only -- works with JS.
To Reproduce
- Define custom component:
// app/components/my-control.ts
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout/stack-layout";
import { Label } from "tns-core-modules/ui/label/label";
import { Button } from "tns-core-modules/ui/button/button";
export class MyControl extends StackLayout {
constructor() {
super();
let counter: number = 0;
const lbl = new Label();
const btn = new Button();
btn.text = "Tap me!";
btn.on("tap", (args) => {
lbl.text = "Tap " + counter++;
});
this.addChild(lbl);
this.addChild(btn);
}
}
- Reference it in a page:
<!-- app/main-page.xml -->
<Page xmlns:customControls="components/my-control" navigatingTo="navigatingTo" class="page">
<customControls:MyControl />
</Page>
- Build app with bundle workflow
Expected behavior
Code-only custom components should work with bundle workflow.
Reactions are currently unavailable
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
Describe the bug
Code-only custom components do not work with bundle workflow. NOTE: seems the issue is TypeScript only -- works with JS.
To Reproduce
Expected behavior
Code-only custom components should work with bundle workflow.