fordth / jinqJs

jinqJs provides a simple way to perform SQL like queries on javaScript arrays, collections and web services using LINQ expressions.
Other
93 stars 29 forks source link

If not an Array of Objects #11

Closed leonibr closed 8 years ago

leonibr commented 8 years ago

Hi, context:

` function GridRow(number, description) { this.id = uuid(); this.number = number; this.description = description; ///other properties not shown }

var grid = []; grid.push(new GridRow(12345, 'test desc'));

//This works var result = new jinqJs() .from(grid) .select(); //This fails var failedResult = new jinqJs() .from(grid) .select('id'); // or any combination of fields ` It seems that it only accepts typeof 'object', not GridRow Object

leonibr commented 8 years ago

For now I am replacing the constructor:

function GridRow(number, description) { return { id : uuid(), number : number, description : description }; }

fordth commented 8 years ago

Yes you are correct, it has to be a JSON object not a function. I developed it with only using JSON objects in mind.

leonibr commented 8 years ago

It is nice. I love it. Thanks for sharing Em 11/03/2016 09:43, "fordth" notifications@github.com escreveu:

Closed #11 https://github.com/fordth/jinqJs/issues/11.

— Reply to this email directly or view it on GitHub https://github.com/fordth/jinqJs/issues/11#event-586342386.

fordth commented 8 years ago

Great to hear, thank you!