Create new checkbox from js code



how can I create new checkbox from js code? I’m using this pugin:

I tried:
const CheckBox = require(‘nativescript-checkbox’);
const myCheckBox = new CheckBox();

but its not working.
error is: Object is not a constructor.

@bradwaynemartin @wwwalkerrun


Your error has all details, it supposed to be

const CheckBox = require(‘nativescript-checkbox’).CheckBox ;

This is one of the reasons why TypeScript feels great :wink: