Angular 11 Strict: can't access OverlayScrollbars Inputs
See original GitHub issueDescribe the bug
If you create a new Angular 11 app with strict type checking (ng new <name> --strict
) it sets angularCompilerOptions.strictInputAccessModifiers
to true
in tsconfig.json. strictInputAccessModifiers
honors @Input() access modifiers, and because they are currently set to private
they are inaccessible:
This is the compiler error you’ll see:
error TS2341: Property '_options' is private and only accessible within class 'OverlayScrollbarsComponent'.
<overlay-scrollbars [options]="scrollOptions">
~~~~~~~~~~~~~~~~~~~~~~~~~
To Reproduce Steps to reproduce the behavior:
- Set
strictInputAccessModifiers
to true intsconfig.json
for an Angular 11 app - Attempt to use the
options
orextensions
OS inputs
Expected behavior There should be no template errors when using strict type checking
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Angular 2+: Multiple definitions of a property not allowed in ...
I had the same issue, it still exists in Angular. Reason of error. SyntaxError: Multiple definitions of a property not allowed in strict...
Read more >overlayscrollbars-ngx - npm
OverlayScrollbars for Angular. ... Start using overlayscrollbars-ngx in your project by running `npm i overlayscrollbars-ngx`.
Read more >× typeerror: cannot read properties of null ... - You.com
I'm trying to add a searchBox to my Google Maps API map, I already activated placesAPI but when I try to call it...
Read more >@storybook/addon-controls | Yarn - Package Manager
Interact with component inputs dynamically in the Storybook UI ... Support Angular 15.0.4 #20287; CLI: execute automigrations when pressing enter in the ...
Read more >Diff - ff1db7c1c9..54c4473401 - chromium/src - Git at Google
-40,11 +40,11 @@ # Three lines of non-changing comments so that # the commit queue can ... + '/external/github.com/open-source-parsers/jsoncpp.git' + '@' + ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed with version 1.13.1 /
"overlayscrollbars-ngx": "0.2.3"
I’ve done something similar, I think you would want to keep the variable private and change the Inputs to setters (and no getters). Something like this: