New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-whenscrolled

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-whenscrolled

Infinite Scroll for AngularJS

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

angular-whenScrolled (version 1.1.2)

angular-whenScrolled is a directive that you can use to implement infinite scrolling in your AngularJS applications. (NO requires jQuery to run)

Getting Started

  • Download angular-whenScrolled.js
  • Include the script tag on your page:
<script type='text/javascript' src='path/to/angular-whenScrolled.js'></script>
  • Ensure that your application module specifies angular-whenScrolled as a dependency:
angular.module('myApplication', ['angular-whenScrolled']);
  • Use the directive by specifying an whenScrolled attribute on an element.
angular.controller("demo", function ($scope, $http) {
    $scope.items = [];
    $scope.totalItems=0;    
    $scope.startList = 0;
    $scope.stopLoadingData = false;

    $scope.more = function () {
        if (!$scope.stopLoadingData) {
            $scope.loading = true;
            $http.post("/app/items", {"startList": $scope.startList}).success(function (data) {
                $scope.totalItems=data.totalItems;
                angular.forEach(data.items,function (key) {
                    $scope.items.push(key);                    
                });      
                $scope.stopLoadingData = ($scope.items.length === $scope.totalItems);
                $scope.startList += 10;
            });
        };
        $scope.loading = false;
    };
    $scope.more();//twice execute-> controller:load and scroll:load
});
  • html:
<div ng-controller='demo'>
    <ANY when-scrolled="more()" >
    </ANY>
    <div ng-show='loading'>Loading Data ...</div>
<div>

Keywords

FAQs

Package last updated on 09 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc