Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ajonesb opened this issue Aug 28, 2018 · 2 comments
Open

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

ajonesb opened this issue Aug 28, 2018 · 2 comments

Comments

@ajonesb
Copy link

ajonesb commented Aug 28, 2018

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();
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

@DeezSmith
Copy link

Your defining a javascript var with TypeScript Interface syntax

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

@jkuri
Copy link
Owner

jkuri commented Sep 5, 2018

Checking demo sample would also be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants