Skip to content

deadlyfingers/ng-infinite-scroll

Repository files navigation

This project was generated with Angular CLI version 8.3.20 optimised for Typescript development in VSCode. The sample app features an infinite scrolling list fetching paginated data from a publicly available source using a GraphQL query.

Developer Environment Status
Typescript Yes
SCSS Yes
Linting Yes
Tests Yes
Run tests coverage (ng test) Yes
Debugging using VSCode Yes
Debug tests using VSCode No
Live reload (ng serve) Yes
External device testing (BrowserSync) Yes

There are a number of third party list view components available for Angular but I choose the cdk-virtual-scroll-viewport component from the Angular Component Dev Kit (CDK) as it supports recycling view cells which is important for responsive and fluid scrolling with 1000s of items.

CDK Virtual Scroll Component features Status
Recycled / virtualized elements Yes
Pagination using infinite scrolling Yes
List view Yes
Responsive list view styles Todo
Responsive grid view styles Unknown

Future plans

  • Further abstract ListViewContainer component with tests
  • Further abstract GraphQL query with tests
  • Add detail view
  • Implement Redux for app state management

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Additional scripts

npm run test:coverage

Shows project source code test coverage.

npm run dev

Runs ng serve and starts a BrowserSync proxy on http://localhost:3000/ and external IP to enable testing on multiple devices connected to the same network.

npm run deploy

Triggers manual deployment to GitHub Pages.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.