Creating a new plugin which uses a template



I’m trying to create a plugin which wraps the scanbot sdk. I have created a plugin with a template and within this template I am using scanbot’s camera view component

<GridLayout rows="auto" columns="auto">
    < id="cameraView" row="0" col="0" />
    <Button id="but" text="Button" row="1" col="0"></Button>


In my code however I cannot seem to get an instance of my cameraView component - I added a button to test and the button works fine

    const innerComponent = builder.load(__dirname + '/barcode-scanner.xml') as View;
    innerComponent.bindingContext = this;

    const cameraView = innerComponent.getViewById('cameraView');
    console.log(cameraView); // this is undefined
    const button = innerComponent.getViewById('but');

    button.on(buttonModule.Button.tapEvent, function (args: observable.EventData) {



The library is included as I can inittialize the sdk fine.


For anyone else interested, this is the wrong way to go about it.

Apparently you can create a programmatic view and then add an instance of ScanbotCameraView to it.