All Projects → b3rew → loopback-row-count-mixin

b3rew / loopback-row-count-mixin

Licence: MIT license
A loopback mixin to get total count of a model

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to loopback-row-count-mixin

loopback-paginator
No description or website provided.
Stars: ✭ 13 (+0%)
Mutual labels:  pagination, loopback-mixin
Cometary
Roslyn extensions, with a touch of meta-programming.
Stars: ✭ 31 (+138.46%)
Mutual labels:  mixins
repository
[PHP 7] Implementation and definition of a base Repository in Domain land.
Stars: ✭ 26 (+100%)
Mutual labels:  pagination
data
Data providers
Stars: ✭ 31 (+138.46%)
Mutual labels:  pagination
Sledgehammer
Smashes the stupid out of the client & server.
Stars: ✭ 13 (+0%)
Mutual labels:  mixins
plazar-js
Modular framework built with enterprise in mind - http://www.plazarjs.com
Stars: ✭ 25 (+92.31%)
Mutual labels:  mixins
beer-app
🍺 Example App - Paginate API response with BLoC in Flutter
Stars: ✭ 20 (+53.85%)
Mutual labels:  pagination
PagedLists
Paginated UITableView and UICollectionViews for iOS.
Stars: ✭ 69 (+430.77%)
Mutual labels:  pagination
redux-paginator
redux-paginator helps you deal with paginated API with Redux without the need to create new actions and reducers cases
Stars: ✭ 73 (+461.54%)
Mutual labels:  pagination
rupture-sass
Better media queries mixins library for SASS
Stars: ✭ 47 (+261.54%)
Mutual labels:  mixins
gorm-paginator
gorm pagination extension
Stars: ✭ 154 (+1084.62%)
Mutual labels:  pagination
roove
Dating app based on firebase services and facebook login. MVVM-Kotlin-RxJava-Dagger-Databinding
Stars: ✭ 55 (+323.08%)
Mutual labels:  pagination
less-mix
LESS-Mix - is a functional, powerful and convenient library LESS-mixins.
Stars: ✭ 22 (+69.23%)
Mutual labels:  mixins
loopback-ds-paginate-mixin
A mixin to provide pagination for loopback Model properties
Stars: ✭ 31 (+138.46%)
Mutual labels:  loopback-mixin
chameleon-sdk
Chameleon Software Development Kit
Stars: ✭ 12 (-7.69%)
Mutual labels:  mixins
11r
America's favorite Eleventy blog template.
Stars: ✭ 135 (+938.46%)
Mutual labels:  pagination
sass-boilerplate
A collection of common use Sass stylesheets, mixins and functions.
Stars: ✭ 60 (+361.54%)
Mutual labels:  mixins
EasyDataTable
易用和全面的纯Ajax分页插件(中文)
Stars: ✭ 18 (+38.46%)
Mutual labels:  pagination
MMM-page-indicator
MagicMirror² module to display what page you're on.
Stars: ✭ 33 (+153.85%)
Mutual labels:  pagination
typescript-mix
A tweaked implementation of TypeScript's default applyMixins(...) idea using ES7 decorators
Stars: ✭ 81 (+523.08%)
Mutual labels:  mixins

loopback-row-count-mixin

A mixin to get total count of a model for pagination in a loopback Model.

INSTALL

npm install --save loopback-row-count-mixin
you can enable mixin by editing server.js:

In your server/server.js file add the following line before the boot(app, __dirname); line.

...
var app = module.exports = loopback();
...
// Add Counts Mixin to loopback
require('loopback-row-count-mixin')(app);

boot(app, __dirname, function(err) {
  'use strict';
  if (err) throw err;

  // start the server if `$ node server.js`
  if (require.main === module)
    app.start();
});

CONFIG

To use with your Models add the mixins attribute to the definition object of your model config.

{
  "name": "player",
  "properties": {
    "name": "string",
    "type": "string",
  },
  "mixins": {
    "RowCount": true
  }
}

USAGE

EXAMPLE

http://0.0.0.0:3000/api/players

will return list of players with field to help for you pagination

{
    "count": 2,
    "rows": [
      {
        "id": 1,
        "title": "First player",
        "type": ""
      },
      {
        "id": 2,
        "title": "Second player",
        "type": ""
      }
    ]
}

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].