Solution #1: Unexpected value 'SlimSliderDirective...'

Consider the first complete error mentioned in the preceding section:

ERROR in Unexpected value 'SlimSliderDirective in /path/to/TNSStudio/app/modules/player/directives/slider.directive.d.ts' declared by the module 'PlayerModule in /path/to/TNSStudio/app/modules/player/player.module.ts'. Please add a @Pipe/@Directive/@Component annotation.

The solution to the preceding error is to install an additional webpack plugin:

npm install nativescript-webpack-import-replace --save-dev

Then, open webpack.config.js and configure the plugin as follows:

function getPlugins(platform, env) {    let plugins = [      ...      new ImportReplacePlugin({          platform: platform,          files: [              'slider.directive'          ]      }),      ...

This ...

Get NativeScript for Angular Mobile Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.