davidchin / angular-endless-scroll Goto Github PK
View Code? Open in Web Editor NEWEndless scrolling for AngularJS
License: MIT License
Endless scrolling for AngularJS
License: MIT License
Could you please suggest a way how to synch-up browser scrollbar position with scrolling content.
It keeps on firing $scope.$on('endlessScroll:next', function () {
});
I had to modify the _onScroll function to include if (this.scope.$$phase), this allows scrolling from within another digest cycle. I was getting a $digest already in progress error. Any thoughts?
`EndlessScroller.prototype._onScroll = function () {
* if (this.scope.$$phase) {
// Define a throttled check method, if it's not already defined
if (!this._throttledCheck) {
this._throttledCheck = throttle(angular.bind(this, this.check), this.options.scrollThrottle);
}
// Check if there's a need to fetch more data
this._throttledCheck();
} else {*
this.scope.$apply(angular.bind(this, function() {
// Define a throttled check method, if it's not already defined
if (!this._throttledCheck) {
this._throttledCheck = throttle(angular.bind(this, this.check), this.options.scrollThrottle);
}
// Check if there's a need to fetch more data
this._throttledCheck();
}));
}
};`
angular.js:13920 TypeError: Cannot read property 'item' of undefined
at EndlessScroller.<anonymous> (angular-endless-scroll.js:519)
at HTMLLIElement.<anonymous> (angular.js:1247)
at Function.each (jquery.js:368)
at jQuery.each (jquery.js:157)
at EndlessScroller._getDimension (angular-endless-scroll.js:514)
at EndlessScroller.clean (angular-endless-scroll.js:296)
at EndlessScroller.check (angular-endless-scroll.js:145)
at EndlessScroller.<anonymous> (angular.js:1248)
at EndlessScroller._throttledCheck (angular-endless-scroll.js:64)
at EndlessScroller.<anonymous> (angular-endless-scroll.js:437)
Hi, Really like this addition to deal with large endless scrolling lists, it worked great for me until I realized that if my source list changed the UI would not update. So in my scenario I was binding a repeater to the results of a REST api call and all was well in the world until the user changes the filters on the display and the REST api is called to reload the array, ergo needing to rebind the repeater. After a little investigation I found the following 2 lines of code fixed the issue. Not sure if it fundamentally changes what your goal was so I'm just sharing, use as you like.
In the _watch prototype, I modified your $watchCollection by including the test to see if the originalItems and the arguments arrays were different...
this.scope.$watchCollection(collectionExp, angular.bind(this, function watchCollection() {
if(this.originalItems && this.items && this.originalItems.length > 0 && JSON.stringify(arguments[0]) !== JSON.stringify(this.originalItems))
this.items = [];
this.update.apply(this, arguments);
}));
Hi. Firstly, amazing—love the package. We need more packages that provide behaviour without custom style and scope.
I am trying to create a UI with endless-scroll but when I position an element absolutely the even never fires. Heres a jsbin http://jsbin.com/qidimahivi/edit?html,output – without the .col-md-4 style it works just perfectly.
Hi, thanks for the great lib! Simple and solve the problem!
I am using this lib on a table like this:
<table class="table table-condensed table-hover">
<tr>
<th>my headers...</th>
</tr>
<div endless-scroll="obj in objs">
<tr><td></td></tr>
</div>
</table>
I go to the bottom of the page, it loads correctly and the height of the table increase. So I move to the bottom again and it works fine again.
BUT, if I go the top, the endless works but the height of my table does not increase. So, I have to move a little to bottom and them I need to move back to the top to load again.
Do you have some tip to solve this issue?
Thanks in advance!
I've tried a number of infinite-scroll type directives, and I've had the same issue from the inner workings. I have two scrolling containers on the same level of the DOM tree. One is a sidebar and the other is the main body.
The problem is that when I scroll to the bottom of the main body, it stops triggering the infinite scroll event (with the other 3 directives I've tried, it works again when I scroll up, this one doesn't work at all once I scroll to the bottom). I'm using Google Chrome. I have a sample here. http://embed.plnkr.co/Y9RJYq4l1CcsXQbvgeH1/preview It's not my actual app, but it's structurally similar and does repeat the bug. (If you have a very large screen you may need to shrink the window down to force everything to have scroll bars).
in the README, external site, wiki..
Since child is a jQuery object, there's no scope function.
I think it should be angular.element(child).scope()
// Set default placeholder attrs
defaultPlaceholderAttrs = {
visibility: 'hidden',
padding: 0,
border: 0
};
for me it should be display: none;
When I comment out the line that sets its height everything works fine. Is it necessary? What is its intended function?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.