ng-scrollbars icon indicating copy to clipboard operation
ng-scrollbars copied to clipboard

Specific config kills general (default) config

Open poshest opened this issue 7 years ago • 0 comments

I have some default config thus:

ScrollBarsProvider.defaults = {
...
, "mouseWheel": {
        "scrollAmount": 100 
      , "preventDefault": true
      ...
   }
...
}

Then in a specific instance I want to override "preventDefault": false, but leave all of the other settings, such as "scrollAmount": 100 intact.

Your config merge routine in the render function seems to intelligently merge config in the way I want, but only at the "top" level of the config object. Nested "general" objects are just replaced whole by the "specific" objects. Eg scrollAmount in the above example is killed.

Couldn't you just use an angular.merge in render? I note that it has been just freshly deprecated in 1.6.5, but as they say, angular.merge "will not be removed in the 1.x lifecycle".

Thanks!

poshest avatar Jul 01 '17 21:07 poshest