colintoh / sails-hook-pagify Goto Github PK
View Code? Open in Web Editor NEWGenerate pagination data and metadata for Sails JS projects
Generate pagination data and metadata for Sails JS projects
Have an error
TypeError: City.pagify is not a function
City.pagify('city', { populate: ['region'], page: 1, perPage: 10 // Overwrite the project-wide settings }).then(function(data) { console.log('data', data); }).catch(function(err) { // err.Errors contains the error messages });
Hallo, I'm using Sails 0.12.3 within the code below:
Panda.pagify('pandas', {
findQuery: {'name': {'like': '%foratemer%'}},
sort: ['createdAt DESC'],
page: 1
}).then(function(data){
}).catch(function(err){
});
And it screams at me this:
TypeError: Cannot read property 'defaults' of undefined
at _getPage (.../server/node_modules/sails-hook-pagify/lib/pagify.js:22:20)
at child.model.pagify (.../server/node_modules/sails-hook-pagify/lib/pagify.js:72:16)
I just added
var _ = require("underscore");
and it worked. I'm new to Sails and javascript (server side), so I am not sure if this is the right way of fixing this issue.
Thanx for this plugin.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.