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

Scroll down to load more #96

Open
hieugie opened this issue Oct 5, 2015 · 0 comments
Open

Scroll down to load more #96

hieugie opened this issue Oct 5, 2015 · 0 comments

Comments

@hieugie
Copy link

hieugie commented Oct 5, 2015

Let's see my code below
Did i do something wrong ?

<div class="container" ng-controller="gridController" when-scrolled="loadMore()">
    <div deckgrid source="photos" cardTemplate="templates/card.html" class="deckgrid" ></div>
</div>

studiouskids.directive('whenScrolled', function() {
return function(scope, elm, attr) {
var raw = elm[0];
elm.bind('scroll', function() {
if (raw.scrollTop + raw.offsetHeight >= raw.scrollHeight) {
scope.$apply(attr.whenScrolled);
}
});
};
});

$scope.loadMore = function() {
$scope.photos.push({id: 'photo-1', title: 'Photo', src: 'http://lorempixel.com/400/300/abstract',
}

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

No branches or pull requests

1 participant