Integrate a custom NativeScript UI component plugin via npm and registerElement

Share this video with your friends

Send Tweet

Plugins are the key to unlocking many rich features of the native platforms. Let’s learn how to integrate the nativescript-checkbox plugin to register a new custom UI component for use in our views.

Guru Inamdar
Guru Inamdar
~ 8 years ago

it did not work from me as is i.e. installing the plugin checkbox using npm install. On android it could not find the plugin. see the link below for workaround if you are using npm version 3 or greater. https://github.com/NativeScript/nativescript-angular/issues/423

  1. create .npmrc file at root of your project and add legacy-bundling=true
  2. remove node_modules and platforms directory
  3. run npm install again
  4. and tns platform add android
  5. run again e.g. ~/project/ng-native (rxJS)*$ tns livesync android --emulator --watch