ngx-slimscroll icon indicating copy to clipboard operation
ngx-slimscroll copied to clipboard

'string' only refers to a type, but is being used as a value here.

Open ajonesb opened this issue 6 years ago • 2 comments

HI, I am adding on my component just as the documentation says as is, followed each step : https://www.npmjs.com/package/ngx-slimscroll

ngOnInit() {
this.scrollEvents = new EventEmitter<SlimScrollEvent>(); this.opts = { position?: string; // left | right barBackground?: string; // #C9C9C9 barOpacity?: string; // 0.8 barWidth?: string; // 10 barBorderRadius?: string; // 20 barMargin?: string; // 0 gridBackground?: string; // #D9D9D9 gridOpacity?: string; // 1 gridWidth?: string; // 2 gridBorderRadius?: string; // 20 gridMargin?: string; // 0 alwaysVisible?: boolean; // true visibleTimeout?: number; // 1000 scrollSensitivity?: number; // 1 };

this.play();

}

}

However getting the same error for each property "'string' only refers to a type, but is being used as a value here."

How can I modify this without errors please?

image

image

ajonesb avatar Aug 28 '18 20:08 ajonesb

Your defining a javascript var with TypeScript Interface syntax

opts : ISlimScrollOptions = {
position 'left',
barBackground: '#C9C9C9',
barOpacity: 0.8, 
etc ...
};

DeezSmith avatar Sep 05 '18 17:09 DeezSmith

Checking demo sample would also be helpful.

jkuri avatar Sep 05 '18 18:09 jkuri