mtr / angular-iscroll

AngularJS module that enables iScroll 5 functionality, wrapping it in an easy-to-use directive.
MIT License
74 stars 27 forks source link

Passing options for iScroll and directive fixed. #5

Closed wkwiatek closed 9 years ago

wkwiatek commented 9 years ago

Currently there is no way of passing directive's options as stated in readme:

<div iscroll="{iScroll: {mouseWheel: true, momentum: true}, directive: {refreshInterval: 500}}">…</div>

It takes whole directive's options content as iScroll options, so the way it works is:

<div iscroll="{mouseWheel: true, momentum: true}">…</div>

These small changes are to fix this inconsistency.

mtr commented 9 years ago

Hi, @wkwiatek.

Thanks for the pull request. However, I think that the error is actually in the documentation in the README.md, which should have read

<div iscroll="{mouseWheel: true, momentum: true, refreshInterval: 500}">…</div>

because the directive was designed to split IScroll-specific and directive-specific config parameters into separate config objects. The code around _extractOptions() at https://github.com/mtr/angular-iscroll/blob/master/src/lib/angular-iscroll.js#L187 will remove directive-specific options from the config object being forwarded to IScroll.

I suggest that I just correct the README.md, as I did in d91eee8434e5de088bcb5d6650210e3e691ea60d. Is that OK with you?

wkwiatek commented 9 years ago

Okay, fair enough. Thanks for your immediate response.

mtr commented 9 years ago

OK. Since I've already updated the documentation, I'll close this PR now.