Giter VIP home page Giter VIP logo

angular-endless-scroll's Introduction

davidchin.me

angular-endless-scroll's People

Contributors

davidchin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

angular-endless-scroll's Issues

Adding additional DOM elements and scrolling within $digest cycle

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();
          }));
      }
  };`

Cannot read property 'item' of undefined

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)

Watch not dealing with change in source

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);
}));

Endless table

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!

Trouble with infinite scroll inside a scrollable element.

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).

line 476: child.scope()

Since child is a jQuery object, there's no scope function.
I think it should be angular.element(child).scope()

placeholder breaking my view

// Set default placeholder attrs
defaultPlaceholderAttrs = {
visibility: 'hidden',
padding: 0,
border: 0
};

for me it should be display: none;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.