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

ngSlimscroll for ng-repeat #10

Open
Nishanthi opened this issue Oct 28, 2015 · 3 comments
Open

ngSlimscroll for ng-repeat #10

Nishanthi opened this issue Oct 28, 2015 · 3 comments
Labels

Comments

@Nishanthi
Copy link

Hi, can we use this directive on ng-repeat?
If not can anyone suggest a directive that supports scrolling on ng-repeat, with custom css will be more favorable.

@agrigory777
Copy link

hey, seems like it is not the matter of ng-repeat.
if i have a hardcoded text in ng-repeat - it works fine.
but if I inotiate a text in controller like $scope.text = 'text....' and then put in directive, like:

{{text}}

it does not work

@agrigory777
Copy link

I found the problem:
look at

scope.getBarHeight = function () {
var barHeight = Math.max((el.offsetHeight / el.scrollHeight) * el.offsetHeight, minBarHeight);
bar.css({ 'height': barHeight + 'px' });
var display = barHeight === el.offsetHeight ? 'none' : 'block';
bar.css({ display: display });
};

the el.scrollHeight is updating after data binding and scroll bar should update and appear then, but the directive does not know about that and still uses old value of el.scrollHeight, so scrolling bar does not appear!

for now I'm setting watch-content="true" and it works

@djoks
Copy link

djoks commented May 4, 2016

@agrigory1982 where exactly did you set "watch-content='true'" i put it on the div with a height of 100% which has an ng-repeat but it did not work.

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

No branches or pull requests

4 participants