ngx-slimscroll
ngx-slimscroll copied to clipboard
'string' only refers to a type, but is being used as a value here.
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?
Your defining a javascript var with TypeScript Interface syntax
opts : ISlimScrollOptions = {
position 'left',
barBackground: '#C9C9C9',
barOpacity: 0.8,
etc ...
};
Checking demo sample would also be helpful.